Skip to content

Commit 4affc86

Browse files
authored
Merge branch 'main' into 300-consolidate
2 parents 3eaa044 + 9e868ba commit 4affc86

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of
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)
1515

16+
## Pre-commit
17+
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.
18+
19+
To set yourself up for running pre-commit checks locally and to catch issues before pushing your changes, follow these steps:
20+
21+
* Install pre-commit with: `pip install pre-commit`
22+
* You can manually check all files at any time by running: `pre-commit run --all-files`
23+
24+
This command runs all configured hooks (such as linters and formatters) across your repository, letting you review and address issues before committing.
25+
26+
**Optional: Enable automatic checks on every commit**
27+
If you want pre-commit hooks to run automatically each time you make a commit, install the git hook with:
28+
29+
`pre-commit install`
30+
31+
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.
32+
33+
**Note on workflow flexibility**
34+
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.
35+
36+
Choose the setup that best fits your workflow and development style.
37+
1638
## Code signing
1739

1840
This repository implements a security check to prevent the CI system from running untrusted code. A part of the

0 commit comments

Comments
 (0)