-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6353bf0
commit 3e9646e
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contributing | ||
|
||
Contributions and Pull Requests are very welcome. If you are planning to implement a larger feature please open an issue | ||
prior to minimize the risk of multiple people working on the same thing simultaneously; or to discuss some specifics of | ||
the feature. | ||
|
||
Neogit draws heavy inspiration from [Magit](https://magit.vc/), but aims to be its own thing. Many of our features are | ||
inspired by Magit, such as the branch keybindings. | ||
|
||
|
||
## Architecture | ||
|
||
- [`./lua/neogit/`] | ||
- [`./lua/neogit/lib/`] Contains various git and filesystem abtractions | ||
- [`./lua/neogit/lib/git/`] High level git wrappers for commont commands such as branches, fetch. These are also used to | ||
supply the status buffer | ||
- [`./lua/neogit/lib/git/cli.lua`] Builder like pattern for constructing git cli invocations | ||
- [`./lua/neogit/lib/git/repository.lua`] Modules from `git/` for updating the statusbuffer | ||
- [`./lua/neogit.lua`] | ||
|
||
Neogit uses its own UI drawing library for drawing columns and rows of text. | ||
|
||
### Making a new view | ||
|
||
Neogit's views, such as the `commit` buffer, `log` graph buffer, etc are located in [`./lua/neogit/buffers/`]. They | ||
are split in a `init.lua` for creating the buffer and setting up keymaps and actions, and `ui.lua` for rendering the | ||
buffer. The split is such that it is easier to get an overview of how the buffer will *look* without the clutter of git | ||
commands and actions. | ||
|
||
Opening a view is typically done through a *popup* which allows you to configure options before invoking the view. | ||
|
||
These reside inside [`./lua/neogit/popups/`], and are split into `init.lua` and `actions.lua` for the setup and keybindings, and the git commands to execute, likewise intended to get an overview of the options and keybindings for the popup in `init.lua` without concerning yourself with the git commands and parsing in `actions.lua`. | ||
|
||
## Code Standards | ||
|
||
### Testing | ||
|
||
Neogit is tested using [Plenary](https://github.com/nvim-lua/plenary.nvim#plenarytest_harness). | ||
|
||
A [Makefile](./Makefile) is set up to run tests. | ||
|
||
```sh | ||
make test | ||
``` | ||
|
||
### Linting | ||
|
||
Additionally, linting is enforced using `selene` to catch common errors, most of which are also caught by | ||
`lua-language-server`. | ||
|
||
```sh | ||
make lint | ||
``` | ||
|
||
### Formatting | ||
|
||
`stylua` is used for formatting. This formatting is slightly different from the built in formatting for | ||
`lua-language-server`. |