Code static analysis and style
Python is a dynamic language where many things are evaluated at run-time. So it is different from compiled languages. It means that if you do typos, errors may only occur when running the program. Using a static analysis program can detect errors without executing your program.
Another way to avoid typos and increase readability, is using coding standards for formatting your code. It makes all your code look the same and it eases comprehension. For Python there is even an official coding style guide defined in the Python Enhancement Proposal 8 (PEP8).
In this section you will use two tools to perform static analysis and code style checking : Pylint and Pycodestyle.
- Run the two commands :
pylint gitlabciintroduction
pycodestyle
You should get a lot of errors and warnings.
Home | C++ Home | << Python Previous - Code coverage | >> Python Next - GitLab CI pipelines