diff options
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r-- | SUBMITTING_PATCHES.md | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md index 76c167c3..df245a52 100644 --- a/SUBMITTING_PATCHES.md +++ b/SUBMITTING_PATCHES.md | |||
@@ -4,7 +4,6 @@ | |||
4 | 4 | ||
5 | - Make small logical changes. | 5 | - Make small logical changes. |
6 | - [Provide a meaningful commit message][commit-message-style]. | 6 | - [Provide a meaningful commit message][commit-message-style]. |
7 | - Check for coding errors and style nits with flake8. | ||
8 | - Make sure all code is under the Apache License, 2.0. | 7 | - Make sure all code is under the Apache License, 2.0. |
9 | - Publish your changes for review. | 8 | - Publish your changes for review. |
10 | - Make corrections if requested. | 9 | - Make corrections if requested. |
@@ -39,17 +38,26 @@ If your description starts to get too long, that's a sign that you | |||
39 | probably need to split up your commit to finer grained pieces. | 38 | probably need to split up your commit to finer grained pieces. |
40 | 39 | ||
41 | 40 | ||
42 | ## Check for coding errors and style violations with flake8 | 41 | ## Linting and formatting code |
43 | 42 | ||
44 | Run `flake8` on changed modules: | 43 | Lint any changes by running: |
44 | ```sh | ||
45 | $ tox -e lint -- file.py | ||
46 | ``` | ||
45 | 47 | ||
46 | flake8 file.py | 48 | And format with: |
49 | ```sh | ||
50 | $ tox -e format -- file.py | ||
51 | ``` | ||
47 | 52 | ||
48 | Note that repo generally follows [Google's Python Style Guide] rather than | 53 | Or format everything: |
49 | [PEP 8], with a couple of notable exceptions: | 54 | ```sh |
55 | $ tox -e format | ||
56 | ``` | ||
50 | 57 | ||
51 | * Indentation is at 2 columns rather than 4 | 58 | Repo uses [black](https://black.readthedocs.io/) with line length of 80 as its |
52 | * The maximum line length is 100 columns rather than 80 | 59 | formatter and flake8 as its linter. Repo also follows |
60 | [Google's Python Style Guide]. | ||
53 | 61 | ||
54 | There should be no new errors or warnings introduced. | 62 | There should be no new errors or warnings introduced. |
55 | 63 | ||