Skip to content
nicoleclaire edited this page Apr 17, 2022 · 7 revisions

Pylint

Pylint is a tool used to find errors in code. When you run pylint, it will give your code a rating out of 10, and give you line by line where there are mistakes or places to make improvements.

First make sure that the branch you are in is up to date by doing a git pull, then run pylint using:

$Pylint mydocument.py

Pylint will run automatically when you git push, and it should only successfully push when the code has a score of 7/10 or above. Github will send you an email that if you follow the links, it will lead you to a page that rates your code and shows your mistakes.

Here is a list of the error messages that will effect how Pylint grades your code: https://pylint.pycqa.org/en/latest/messages/messages_list.html

A useful website for checking pep8 style is www.pep8online.com Copy over your code and it will highlight mistakes.

black

Another useful tool similar to pylint is black. Black will actually fix simple “errors” in your code (for example things like “trailing whitespace” will be automatically fixed). I recommended running black before running pylint, so many easy fixes are out of the way. How to run Black: $pip3 install black $black [filename] Here is a list of the “errors” that black corrects: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html

Clone this wiki locally