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