Flake8
black
Our great sponsors
Flake8 | black | |
---|---|---|
23 | 281 | |
2,700 | 31,748 | |
3.8% | 2.1% | |
7.9 | 9.6 | |
5 days ago | 4 days ago | |
Python | Python | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Flake8
- Even the Pylint codebase uses Ruff
-
Ruff: A new, fast and correct Python checker/linter
Here are insights about flake8, black, and mypy and the amount of work that went into mypy seems … just massive?!
-
Flake8 took down the gitlab repository in favor of github
So if your pre-commit starts to mysteriously fail, you probably want to switch https://gitlab.com/PyCQA/flake8 for https://github.com/PyCQA/flake8 in your .pre-commit-config.yaml (like here)
to be transparent -- https://github.com/PyCQA/flake8/issues/371
-
Data engineering projects with template: Airflow, dbt, Docker, Terraform (IAC), Github actions (CI/CD) & more
Lint check: flake8
-
Python 3.11.0 final is now available
That probably won't happen any time soon.
See https://github.com/PyCQA/flake8/issues/234#issuecomment-1206...
-
Python 3.11 is out! Huzzah!
Does this mean the maintainer of Flake8 will stop being a stubborn oaf and consider pyproject.toml support?
-
Makefile for your Django project
lint: Runs flake8 linter and mypy type checker.
-
Project template for modern Python packages
Regarding setup.cfg, it's currently used for flake8 related configuration. Flake8 doesn't support pyproject.toml: https://github.com/PyCQA/flake8/issues/234. There are some workarounds, such as https://github.com/john-hen/Flake8-pyproject, but, in my opinion, getting rid of additional config file doesn't really justify additional dependency. However, as setup.cfg is currently used only for flake8 related configs, perhaps it could be replaced by .flake8 file.
-
How to create a Python package in 2022
# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.0.1 hooks: - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: mixed-line-ending - repo: https://github.com/psf/black rev: 22.3.0 hooks: - id: black args: ["--check"] - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: - id: isort args: ["--check", "--profile", "black"] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 hooks: - id: flake8 additional_dependencies: [mccabe] args: ["--max-line-length", "88", "--max-complexity", "10"] - repo: https://github.com/PyCQA/pylint/ rev: v2.14.5 hooks: - id: pylint exclude: tests/ # Prevent files in tests/ to be passed in to pylint.
black
-
The Ruff python linter is insanely good
The whole point of Black is that it's opinionated and that it knows better than you. I can always recommend you read the single quotes incident on GitHub to gain more insight about what Black really is: https://github.com/psf/black/issues/118
-
“Don’t listen to language designers”
Indentation is fine for a presentation layer and indeed prettifiers like black are a good thing. But once you start picking up fragments of code and moving them around, it's much easier to have that interaction when there are visible symbols demarcating the nesting structure.
-
Do I have to do this line by line…please say there is a quick way to do this
A good tool that i use to automatically indent my lines of code for python is 'Black'. https://github.com/psf/black
Even better, set pycharm to use Black and never spend time with formatting again.
Let black do it for you
Someone already did
-
Python projects with best practices on Github?
black is very well organized generic Python project example.
-
Ruff: A new, fast and correct Python checker/linter
Here are insights about flake8, black, and mypy and the amount of work that went into mypy seems … just massive?!
-
Free Code Analysis
black and mypy?
What are some alternatives?
Pylint - It's not just a linter that annoys you!
black - The uncompromising Python code formatter [Moved to: https://github.com/psf/black]
autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.
yapf - A formatter for Python files
pylama - Code audit tool for python.
prettier - Prettier is an opinionated code formatter.
prospector - Inspects Python source files and provides information about type and location of classes, methods etc
autoflake - Removes unused imports and unused variables as reported by pyflakes
isort - A Python utility / library to sort imports.
bandit - Bandit is a tool designed to find common security issues in Python code.