/ CONTRIBUTING.md
CONTRIBUTING.md
1 # Contributing 2 3 Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. 4 5 ## Environment setup 6 7 Nothing easier! 8 9 Fork and clone the repository, then: 10 11 ```bash 12 cd griffe-typedoc 13 make setup 14 ``` 15 16 > NOTE: If it fails for some reason, you'll need to install [uv](https://github.com/astral-sh/uv) manually. 17 > 18 > You can install it with: 19 > 20 > ```bash 21 > curl -LsSf https://astral.sh/uv/install.sh | sh 22 > ``` 23 > 24 > Now you can try running `make setup` again, or simply `uv sync`. 25 26 You now have the dependencies installed. 27 28 You can run the application with `make run griffe-typedoc [ARGS...]`. 29 30 Run `make help` to see all the available actions! 31 32 ## Tasks 33 34 The entry-point to run commands and tasks is the `make` Python script, located in the `scripts` directory. Try running `make` to show the available commands and tasks. The *commands* do not need the Python dependencies to be installed, 35 while the *tasks* do. The cross-platform tasks are written in Python, thanks to [duty](https://github.com/pawamoy/duty). 36 37 If you work in VSCode, we provide [an action to configure VSCode](https://pawamoy.github.io/copier-uv/work/#vscode-setup) for the project. 38 39 ## Development 40 41 As usual: 42 43 1. create a new branch: `git switch -c feature-or-bugfix-name` 44 1. edit the code and/or the documentation 45 46 **Before committing:** 47 48 1. run `make format` to auto-format the code 49 1. run `make check` to check everything (fix any warning) 50 1. run `make test` to run the tests (fix any issue) 51 1. if you updated the documentation or the project dependencies: 52 1. run `make docs` 53 1. go to http://localhost:8000 and check that everything looks good 54 1. follow our [commit message convention](#commit-message-convention) 55 56 If you are unsure about how to fix or ignore a warning, just let the continuous integration fail, and we will help you during review. 57 58 Don't bother updating the changelog, we will take care of this. 59 60 ## Commit message convention 61 62 Commit messages must follow our convention based on the [Angular style](https://gist.github.com/stephenparish/9941e89d80e2bc58a153#format-of-the-commit-message) or the [Karma convention](https://karma-runner.github.io/4.0/dev/git-commit-msg.html): 63 64 ``` 65 <type>[(scope)]: Subject 66 67 [Body] 68 ``` 69 70 **Subject and body must be valid Markdown.** Subject must have proper casing (uppercase for first letter if it makes sense), but no dot at the end, and no punctuation in general. 71 72 Scope and body are optional. Type can be: 73 74 - `build`: About packaging, building wheels, etc. 75 - `chore`: About packaging or repo/files management. 76 - `ci`: About Continuous Integration. 77 - `deps`: Dependencies update. 78 - `docs`: About documentation. 79 - `feat`: New feature. 80 - `fix`: Bug fix. 81 - `perf`: About performance. 82 - `refactor`: Changes that are not features or bug fixes. 83 - `style`: A change in code style/format. 84 - `tests`: About tests. 85 86 If you write a body, please add trailers at the end (for example issues and PR references, or co-authors), without relying on GitHub's flavored Markdown: 87 88 ``` 89 Body. 90 91 Issue #10: https://github.com/namespace/project/issues/10 92 Related to PR namespace/other-project#15: https://github.com/namespace/other-project/pull/15 93 ``` 94 95 These "trailers" must appear at the end of the body, without any blank lines between them. The trailer title can contain any character except colons `:`. We expect a full URI for each trailer, not just GitHub autolinks (for example, full GitHub URLs for commits and issues, not the hash or the #issue-number). 96 97 We do not enforce a line length on commit messages summary and body, but please avoid very long summaries, and very long lines in the body, unless they are part of code blocks that must not be wrapped. 98 99 ## Pull requests guidelines 100 101 Link to any related issue in the Pull Request message. 102 103 During the review, we recommend using fixups: 104 105 ```bash 106 # SHA is the SHA of the commit you want to fix 107 git commit --fixup=SHA 108 ``` 109 110 Once all the changes are approved, you can squash your commits: 111 112 ```bash 113 git rebase -i --autosquash main 114 ``` 115 116 And force-push: 117 118 ```bash 119 git push -f 120 ``` 121 122 If this seems all too complicated, you can push or force-push each new commit, and we will squash them ourselves if needed, before merging.