Code Quality Tools in Python

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • OPS - Build and Run Open Source Unikernels
  • Scout APM - Less time debugging, more time building
  • GitHub repo pycodestyle

    Simple Python style checker in one Python file

    Linters analyze code to detect various categories of issues like logistical issue and stylistic issues. Some popular linters are Pylint, pycodestyle, Flake8 and Pylama.

  • GitHub repo pyflakes

    A simple program which checks Python source files for errors

    Flake8: a combination of following linters: PyFlakes, pycodestyle, Ned Batchelder’s McCabe script

  • SonarLint

    Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.

  • GitHub repo mccabe

    McCabe complexity checker for Python

    Flake8: a combination of following linters: PyFlakes, pycodestyle, Ned Batchelder’s McCabe script

  • GitHub repo pylama

    Code audit tool for python.

    Linters analyze code to detect various categories of issues like logistical issue and stylistic issues. Some popular linters are Pylint, pycodestyle, Flake8 and Pylama.

  • GitHub repo pydocstyle

    docstring style checker

    pydocstyle

  • GitHub repo black

    The uncompromising Python code formatter

    as per the black's documentation, Black is "The uncompromising Python code formatter". It is my personal favourite because it has minimal configuration and is fast enough. Black is used by some very popular open-source projects, such as pytest, tox, Pyramid, Django Channels, Poetry, and so on. Example usage:

  • GitHub repo yapf

    A formatter for Python files

    YAPF (Yet Another Python Formatter) is Google's official python formatter which follows google's style guide. The documentation is easy to understand the installation and configuration for this formatter.

  • OPS

    OPS - Build and Run Open Source Unikernels. Quickly and easily build and deploy open source unikernels in tens of seconds. Deploy in any language to any cloud.

  • GitHub repo isort

    A Python utility / library to sort imports.

    Formatters automatically format your code based on a style guide. Some popular formatters are Black, YAPF, autopep8 and isort.

  • GitHub repo autopep8

    A tool that automatically formats Python code to conform to the PEP 8 style guide.

    autopep8 is an unofficial, yet popular, tool that automatically formates Python code to conform to PEP 8. It uses pycodestyle, Python’s official PEP-8 violation checker tool, to determine what parts of the code need to be formatted.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts