You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* first try
* first try
* no blank line
* contribution
* normalizing pre-commit configuration to a top-level map
* updated CONTRIBUTING.md
* pull hooks from official codestyle repo
* pin to v21.06rc1
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ It's much harder to merge in a large change with a lot of disjoint features.
96
96
3. Submit the update as a GitHub pull request against the `master` branch.
97
97
4. Make sure that you provide docstrings for all your new methods and classes.
98
98
5. Add new unit tests for your code ([PR examples](#pr-examples)).
99
-
6. Check the [codestyle](#codestyle)
99
+
6. (Optional) Check the [codestyle](#codestyle). We use a pre-commit hook that runs the formatting on commit, so you don't have to.
100
100
7. Make sure that your code [passes the Github CI](#github-ci)
101
101
102
102
@@ -115,19 +115,33 @@ Please use it as a collaborative platform, if you have any issues during the PR.
115
115
### Codestyle
116
116
117
117
We also have our own [catalyst-codestyle](https://github.com/catalyst-team/codestyle)
118
-
package to help with code formatting issues.
118
+
package to help with code formatting issues, and a corresponding pre-commit hook installed.
119
119
120
-
You could check the codestyle for your PR with:
120
+
To set the hook, please run (this requires `pre-commit` package, pinned in the `requirements-dev.txt`):
121
+
```bash
122
+
pre-commit install
123
+
```
124
+
Once the installation is done, all the files that are changed will be formatted automatically (and commit halted if something goes wrong, e.g there is a syntactic error). You can also run the formatting manually:
125
+
```bash
126
+
pre-commit run
127
+
```
121
128
129
+
If for some reason you'll want to turn the hook off temporarily, you can do that with:
Once again, make sure that your python packages complied with `requirements/requirements.txt` and `requirements/requirements-dev.txt` to get codestyle run clean:
138
+
Once again, make sure that your python packages complied with `requirements/requirements.txt` and `requirements/requirements-dev.txt` to get codestyle and pre-commit run clean:
0 commit comments