Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 1015 Bytes

exercise1.md

File metadata and controls

6 lines (5 loc) · 1015 Bytes

Linting Exercise 1

  1. Copy the "exercise1.py" and the "devices.py" files from this directory. Execute this "exercise1.py" code. It should successfully run and should print out NAPALM device facts. While the code is functional, there are some Python-style issues with the code.
  2. Run pylint against this "exercise1.py" file. Create a copy of exercise1.py; name the new file exercise1_pylint.py. Fix all of the Pylint errors that are in this exercise1_pylint.py file.
  3. Run pycodestyle against "exercise1.py". Create a copy of exercise1.py; name the new file exercise1_pep8.py. Fix all of the pycodestyle errors that are in this exercise1_pep8.py file.
  4. Run pylama against the "exercise1_pep8.py" file. At this point, Pylama should report no errors. Note that by default, Pylama will run pycodestyle against your code. Consequently, you should see similar warnings and errors as you did when executing pycodestyle. Pylama, however, also supports additional linters which can potentially identify other issues.