File tree Expand file tree Collapse file tree 2 files changed +21
-11
lines changed
software_and_system_design/coding_style_guide Expand file tree Collapse file tree 2 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,14 @@ redirect_from:
77
88__ Minimum Version__ : 3.8
99
10- For Python, we use [ flake8] ( http://flake8.pycqa.org/en/latest/ ) to check Python code such that it follows things laid out in
11- [ PEP-8] ( https://www.python.org/dev/peps/pep-0008/ ) , [ PEP-257] ( https://www.python.org/dev/peps/pep-0257/ ) , etc.
12- To locally lint the code, you will need to install three modules:
13-
14- pip3 install flake8 flake8-bugbear
15-
10+ For Python, we use [ flake8] ( http://flake8.pycqa.org/en/latest/ ) and [ pylint] ( https://pylint.readthedocs.io/en/stable/ )
11+ to check Python code such that it follows things laid out in [ PEP-8] ( https://www.python.org/dev/peps/pep-0008/ ) ,
12+ [ PEP-257] ( https://www.python.org/dev/peps/pep-0257/ ) , etc. The code is linted as part of our automated Travis-CI
13+ testsuite to ensure compliance. To locally lint the code, you will need to install four modules:
14+ ``` bash
15+ pip3 install flake8 flake8-bugbear pylint
16+ ```
1617and then you can just run ` flake8 ` at the root to check all files or pass it an individual file to check just that.
18+ To see all files that are currently checked as part of Travis-CI, please look at the ` .flake8 ` config file.
19+
20+ For pylint, you can just run ` pylint --recursive=y . ` at the root to check all files or pass it an individual file.
Original file line number Diff line number Diff line change @@ -13,21 +13,27 @@ Be sure to start with the [Initial Set Up](/developer/testing/#initial-set-up) i
1313
1414## Python Linting
1515
16- The Python code of Submitty is linted using [ flake8] ( https://flake8.pycqa.org/en/latest/ ) and
17- [ flake8-bugbear] ( https://github.com/PyCQA/flake8-bugbear ) . You can run the Python linter
18- locally (on your host operating system) by running the following command from the root
16+ The Python code of Submitty is linted using [ flake8] ( https://flake8.pycqa.org/en/latest/ ) ,
17+ [ flake8-bugbear] ( https://github.com/PyCQA/flake8-bugbear ) , and [ pylint ] ( https://pylint.readthedocs.io/en/stable/ ) .
18+ You can run the Python linter locally (on your host operating system) by running the following command from the root
1919level of Submitty source tree:
2020
2121``` bash
22- # from root level of Submitty repository
22+ # from root level of Submitty repository using flake8
2323python3 -m flake8
24+
25+ # from root level of Submitty repository using pylint
26+ python3 -m pylint --recursive=y .
2427```
2528
2629Optionally, you can pass in a specific file or directory to only lint that file or directory, e.g.:
2730
2831``` bash
29- # from root level of Submitty repository... to lint a specific file:
32+ # from root level of Submitty repository... to lint a specific file using flake :
3033python3 -m flake8 bin/generate_repos.py
34+
35+ # from root level of Submitty repository... to lint a specific file using pylint:
36+ python3 -m pylint bin/generate_repos.py
3137```
3238
3339See also: [ Python Style Guide] ( /developer/coding_style_guide/python )
You can’t perform that action at this time.
0 commit comments