summaryrefslogtreecommitdiffstats
path: root/SUBMITTING_PATCHES.md
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2023-03-11 04:35:22 +0000
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-20 20:37:24 +0000
commit1604cf255f8c1786a23388db6d5277ac7949a24a (patch)
tree4bb894bb16fb4a6c65c21335ba14c6ab2a27887a /SUBMITTING_PATCHES.md
parent75eb8ea9354cfcecfaf185a37a10ad2c8b4cd0d2 (diff)
downloadgit-repo-1604cf255f8c1786a23388db6d5277ac7949a24a.tar.gz
Make black with line length 80 repo's code style
Provide a consistent formatting style and tox commands to lint and format. Bug: b/267675342 Change-Id: I33ddfe07af8473f4334c347d156246bfb66d4cfe Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/362954 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r--SUBMITTING_PATCHES.md24
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
39probably need to split up your commit to finer grained pieces. 38probably 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
44Run `flake8` on changed modules: 43Lint any changes by running:
44```sh
45$ tox -e lint -- file.py
46```
45 47
46 flake8 file.py 48And format with:
49```sh
50$ tox -e format -- file.py
51```
47 52
48Note that repo generally follows [Google's Python Style Guide] rather than 53Or 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 58Repo uses [black](https://black.readthedocs.io/) with line length of 80 as its
52* The maximum line length is 100 columns rather than 80 59formatter and flake8 as its linter. Repo also follows
60[Google's Python Style Guide].
53 61
54There should be no new errors or warnings introduced. 62There should be no new errors or warnings introduced.
55 63