Changes between Version 28 and Version 29 of Submitting/Python
- Timestamp:
- Mar 21, 2020, 3:48:20 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Submitting/Python
v28 v29 82 82 === PEP8 standard Style === 83 83 84 Follow PEP8 standard and use the `pep8` tool to check compliance of your code to this standard. You can either install it with `pip3` or it is offered for your operating system as package `python3-pep8`.84 Follow PEP8 standard and use the `pep8` tool to check compliance of your code to this standard. You can either install it with `pip3` or it is offered for your operating system as package ~~`python3-pep8`~~ `python3-pycodestyle`. 85 85 86 86 Update 2020: 87 * `pep8` has been renamed to `pycodestyle `88 * Use of the `pep8` tool will be removed in a future release. Please install and use `pycodestyle` instead.87 * `pep8` has been renamed to `pycodestyle-3` 88 * Use of the `pep8` tool will be removed in future, please install and use `pycodestyle-3` instead. 89 89 90 90 Note that not all code is currently compliant to complete PEP8, so we are using a custom configuration stored in `tools/pep8config.txt` ([https://github.com/OSGeo/grass/blob/master/tools/pep8config.txt here] shipped within the GRASS GIS source code), so use: 91 91 92 92 {{{ 93 p ep8 --config=tools/pep8config.txt directory_to_check94 }}} 95 96 Alternatively, you can use `p ep8` with `--diff` option to check just the parts of the code you have changed:97 98 {{{ 99 git diff | p ep8 --diff --config=tools/pep8config.txt100 }}} 101 102 The best practice is to use pep8with default configuration (i.e., without custom configuration file) for new files and new code in old files.93 pycodestyle-3 --config=grass_master/tools/pep8config.txt directory_to_check 94 }}} 95 96 Alternatively, you can use `pycodestyle-3` with `--diff` option to check just the parts of the code you have changed: 97 98 {{{ 99 git diff | pycodestyle-3 --diff --config=grass_master/tools/pep8config.txt 100 }}} 101 102 The best practice is to use `pycodestyle-3` with default configuration (i.e., without custom configuration file) for new files and new code in old files. 103 103 104 104 Do not fix (intentionally or unintentionally) existing style issues in code (at lines) you are not changing.