From 3366d820a7fc0691a1a43a9ce7c03a5ebb0d239a Mon Sep 17 00:00:00 2001 From: van-tienhoang <40869791+van-tienhoang@users.noreply.github.com> Date: Sat, 18 May 2019 08:42:07 -0400 Subject: [PATCH] Adding alternative tools for coding style (#30493) * Adding alternative tools for coding style Adding alternative tools for coding style * fix: changed console to shell --- guide/english/python/python-coding-standards/index.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guide/english/python/python-coding-standards/index.md b/guide/english/python/python-coding-standards/index.md index 055c5a2049..5e020ba238 100644 --- a/guide/english/python/python-coding-standards/index.md +++ b/guide/english/python/python-coding-standards/index.md @@ -6,6 +6,7 @@ title: Coding standards * Why coding standards? * Intro to PEP 8 * Commands +* Alternative tools ### Why coding standards? The global python community is rapidly growing, and almost everyone uses python. This is where readability of code and uniform standards matter. *Anyone on the planet should be able to read your code and understand what it does*. There are a lot of aspects to understanding other's code, for example comments about what a function does, logically dividing tasks among modules and functions, good variable names, etc. @@ -19,9 +20,16 @@ We love sticking to conventions. The python user community has come up with a se Here's how you check if your python code meets he standards. -```console +```shell :~$ pip install pep8 :~$ pep8 --first myCode.py ``` This will give all those lines which violate the standards, along with a short description of the fixes. + +### Alternative tools +Beside `pep8`, there are some other tools with same functionalities: +* [pylint](https://www.pylint.org) +* [flake8](http://flake8.pycqa.org) +* [pydocstyle](https://github.com/PyCQA/pydocstyle) +Please check their usages.