In this lesson, you will learn:

  • the role of linting
  • the key benefits of using a Python linter.

Whereas formatters look to fix formatting styling, linters work to identify errors, along with recommending best practices and syntax improvements.

For example, this could be checking for syntax issues that may cause issues at runtime (Flake8), checking for security issues within your code (Bandit) or validating that your docstrings are correctly aligned to the PEP styling requirements (PEP257). But linting isn’t limited only to Python: we can also use linting to check our YAML files and Jinja2 templates.

The key benefits of linting your code are that it helps you:

  • catch potential issues before runtime
  • write quality, production-level code
  • ensure your code is not vulnerable and potentially exploitable.
Want to Learn Network Automation?
Join our membership and get access to:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Tech demos and sessions

Join Now ➜