Skip to content

Commit 9e868ba

Browse files
authored
Add lint instructions (#581)
* Add linting instructions to CONTRIBUTING.md * add * signoff Signed-off-by: Mark Saroufim <[email protected]> * update contributing.md --------- Signed-off-by: Mark Saroufim <[email protected]>
1 parent 034ffbf commit 9e868ba

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,24 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of
1212
- Please refer to each component's guideline:
1313
- [`cuda.core`](https://nvidia.github.io/cuda-python/cuda-core/latest/contribute.html)
1414
- [`cuda.bindings`](https://nvidia.github.io/cuda-python/cuda-bindings/latest/contribute.html)
15+
16+
This project uses [pre-commit.ci](https://pre-commit.ci/) with GitHub Actions. All pull requests are automatically checked for pre-commit compliance, and any pre-commit failures will block merging until resolved.
17+
18+
To set yourself up for running pre-commit checks locally and to catch issues before pushing your changes, follow these steps:
19+
20+
* Install pre-commit with: `pip install pre-commit`
21+
* You can manually check all files at any time by running: `pre-commit run --all-files`
22+
23+
This command runs all configured hooks (such as linters and formatters) across your repository, letting you review and address issues before committing.
24+
25+
**Optional: Enable automatic checks on every commit**
26+
If you want pre-commit hooks to run automatically each time you make a commit, install the git hook with:
27+
28+
`pre-commit install`
29+
30+
This sets up a git pre-commit hook so that all configured checks will run before each commit is accepted. If any hook fails, the commit will be blocked until the issues are resolved.
31+
32+
**Note on workflow flexibility**
33+
Some contributors prefer to commit intermediate or work-in-progress changes that may not pass all pre-commit checks, and only clean up their commits before pushing (for example, by squashing and running `pre-commit run --all-files` manually at the end). If this fits your workflow, you may choose not to run `pre-commit install` and instead rely on manual checks. This approach avoids disruption during iterative development, while still ensuring code quality before code is shared or merged.
34+
35+
Choose the setup that best fits your workflow and development style.

0 commit comments

Comments
 (0)