Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR. Learn more →
Top 23 Python Linter Projects
-
disclaimer: I don't work on big codebases.
Pylance with pyright[0] while developing (with strict mode) and mypy[1] with pre-commit and CI.
Previously, I had to rely on pyright in pre-commit and CI for a while because mypy didn’t support PEP 695 until its 1.11 release in July.
[0] -- https://github.com/microsoft/pyright
[1] -- https://github.com/python/mypy
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
Project mention: Crafting a Custom SAM Template for Your AWS Lambda Function, Resource, and Operations | dev.to | 2024-12-10
Just give you an idea of how to implement a template for serverless in your organization; you can create multiple cases and embed the practice of your organization to the template like pre-commit, cicd, lambda-layer-secret, lambda-layer-powertools and more
-
Bandit is a tool designed to find common security issues in Python code. It was developed by the OpenStack Security Project and is a great addition to any serious Python project.
-
# .pre-commit-config.yaml (28.06.2024) repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-added-large-files - repo: https://github.com/PyCQA/isort rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black rev: 24.4.2 hooks: - id: black - repo: https://github.com/pycqa/flake8 rev: 7.1.0 hooks: - id: flake8 - repo: local hooks: - id: django-check name: Run Django Check entry: python manage.py check language: system pass_filenames: false types: [python]
-
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/antonbabenko/pre-commit-terraform rev: v1.72.2 hooks: - id: terraform_fmt - id: terraform_tflint - id: infracost_breakdown args: - --args=--path=./ verbose: true # Always show costs - id: terraform_validate
-
A little introduction about pylint. Pylint is a static code analyzer, it analyses your code without actually running it. Pylint looks for potential errors, gives suggestions on coding standards that your code is not adhering to, potential places where refactoring might help, and also warnings about smelly code.
-
There is also the rarely mentioned pytype from Google, written in Python. And pyright from Microsoft is written in Typescript, pyre at Facebook in OCaml. Last time I checked, these had better type inference algorithms (Hindley-Milner?) than mypy.
https://github.com/google/pytype
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
pyupgrade
A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
-
Flake8
flake8 is a python tool that glues together pycodestyle, pyflakes, mccabe, and third-party plugins to check the style and quality of some python code.
Project mention: Constraints Are Good: Python's Metadata Dilemma | news.ycombinator.com | 2024-12-06I wouldn’t bet on this one. I know a lot of python package maintainers who would likely rather kill their project than to adapt to a standard they don’t like. For example see flake8’s stance on even supporting pyproject.toml files which have been the standard for years: https://github.com/PyCQA/flake8/issues/234#issuecomment-8128...
I know because I’m the one that added pyproject.toml support to mypy 3.5 years ago. Python package developers can rival Linux kernel maintainers for resistance to change.
-
The GitHub Actions Ubuntu runners comes with yamllint installed, meaning it's super simple to create linting/validating workflows to ensure your YAML is valid!
-
-
Now the first 3 options are pretty straight forward. The template itself is a bit more complicated. In my example I used an inline template, I did this for the sake of this blog. But you can also reference an existing object on S3. This way you can use linting tools like cfn-lint on your conformance pack. This will reduce errors during deployment as you can catch them before you commit and push your code.
-
prospector
Inspects Python source files and provides information about type and location of classes, methods etc
-
I was configuring them as I was reading. I have done this before, but we had some months of use since then, and I have seen it working in real-time. I got a lot out of this second read and configuration round. I discovered that I over-configured Cppcheck; there is much more to get out of Cpplint, and I reviewed the JSON Schema versions.
-
Pyflakes is a simple program that checks Python source files for errors. It is similar to PyLint but focuses only on errors, not style. This makes it faster and less intrusive than some other tools.
-
flake8-bugbear
A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.
-
-
Pylama is a code audit tool for Python that wraps tools like Pylint, pycodestyle, PyFlakes, McCabe, and others to provide a unified interface.
-
The project uses a mix of Rust and GDScript, and for linting the GDScript code in GitHub actions, I use godot-gdscript-toolkit.
-
-
sublime-phpcs
🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Sublime-phpcs - adds support for PHP_CodeSniffer, PHP Code Beautifier, PHP CS Fixer, PHP Linter, and PHP Mess Detector.
-
Deal
🤝 Design by contract for Python. Write bug-free code. Add a few decorators, get static analysis and tests for free.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Python Linter discussion
Python Linter related posts
-
Python 3.13.0 Is Released
-
How to Estimate Cloud Costs with Terraform and InfraCost
-
Supercharge Your Python Toolkit with These Powerful Tools
-
Setting up `pre-commit` in a Django project
-
Simple YAML Linter/Validator Workflow for GitHub Actions
-
Dagger.io : La nouvelle ère du CI/CD dans le monde DevOps
-
Introducing Tapyr: Create and Deploy Enterprise-Ready PyShiny Dashboards with Ease
-
A note from our sponsor - CodeRabbit
coderabbit.ai | 12 Dec 2024
Index
What are some of the best open-source Linter projects in Python? This list will help you:
Project | Stars | |
---|---|---|
1 | mypy | 18,658 |
2 | pre-commit | 13,047 |
3 | bandit | 6,543 |
4 | isort | 6,541 |
5 | pre-commit-hooks | 5,404 |
6 | Pylint | 5,345 |
7 | pytype | 4,788 |
8 | proselint | 4,368 |
9 | pyupgrade | 3,629 |
10 | Flake8 | 3,476 |
11 | yamllint | 2,915 |
12 | wemake-python-styleguide | 2,563 |
13 | cfn-python-lint | 2,466 |
14 | prospector | 1,961 |
15 | cpplint | 1,600 |
16 | pyflakes | 1,375 |
17 | flake8-bugbear | 1,065 |
18 | best-of-python-dev | 1,053 |
19 | pylama | 1,049 |
20 | godot-gdscript-toolkit | 1,033 |
21 | autoflake | 905 |
22 | sublime-phpcs | 812 |
23 | Deal | 758 |