Skip to content

Commit 82da3a5

Browse files
roypatzulinx86
authored andcommitted
doc: update pre-commit hook instruction to point to checkstyle
Now that checkstyle runs git-secrets, it is a true superset of the checks that our existing pre-commit hook is running. Since checkstyle is actually what our CI is validating, let's just point the git pre-commit hook instruction to checkstyle, instead of maintaining a separate set of checks somewhere else. Signed-off-by: Patrick Roy <[email protected]>
1 parent 8528c0f commit 82da3a5

File tree

3 files changed

+8
-87
lines changed

3 files changed

+8
-87
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -57,39 +57,19 @@ If you just want to receive feedback for a contribution proposal, open an “RFC
5757
## Contribution Quality Standards
5858

5959
Most quality and style standards are enforced automatically during integration
60-
testing. For ease of use you can setup a git pre-commit hook by running the
60+
testing. For ease of use you can set up a git pre-commit hook by running the
6161
following in the Firecracker root directory:
6262

6363
```
64-
cargo install rusty-hook
65-
rusty-hook init
64+
cat >> .git/hooks/pre-commit << EOF
65+
./tools/devtool checkstyle || exit 1
66+
EOF
6667
```
6768

68-
This project also has linters for Python and Markdown. These will be called by
69-
the pre-commit when you modify any Python and Markdown files. In order to make
70-
sure you are setup we recommend you install
71-
[poetry](https://python-poetry.org/docs/) and
72-
[pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation).
73-
74-
Poetry is used by this project and pyenv will help you make sure you have a
75-
Python version compatible with the poetry python project we use as part of
76-
`./tools/devctr`.
77-
78-
Once you have these two installed you can run the following to install the dev
79-
container poetry project:
80-
81-
```
82-
poetry -C ./tools/devctr install --no-root
83-
```
84-
85-
Then, you can activate the poetry virtual environment by running:
86-
87-
```
88-
poetry shell -C ./tools/devctr
89-
```
90-
91-
Which you will need to do after modifying python or markdown files so that the
92-
pre-commit can finish successfully.
69+
This will automatically lint your Rust, markdown and python changes when running
70+
`git commit`, as well as running any other checks our CI validates as part of
71+
its 'Style' step. Most reported violations can be automatically fixed using
72+
`./tools/devtool fmt`.
9373

9474
Your contribution needs to meet the following standards:
9575

pre-commit

Lines changed: 0 additions & 52 deletions
This file was deleted.

rusty-hook.toml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)