ruff
flake8
Our great sponsors
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.
ruff
-
Ask HN: High quality Python scripts or small libraries to learn from
I think I mention this all the time when this comes up, but I learned the most 'best practices' through using ruff.
https://docs.astral.sh/ruff/
I just installed and enabled all the rules by setting
-
Enhance Your Project Quality with These Top Python Libraries
Ruff is a Python linter that helps to identify and remove code smells. Over 700 built-in rules: Ruff includes native re-implementations of popular Flake8 plugins, like flake8-bugbear. And also built-in caching to avoid re-analyzing unchanged files.
-
Ask HN: What interesting project ideas you've got but have no time to work on?
Because the Python's "ast" modules is too slow, and lacks proper "format" feature (it has unparse but it removes comments, and forgets the current style completely). I use "ruff" a lot (https://github.com/astral-sh/ruff) which is in Rust. But I want to be able to implement fast custom linters in Go (linters that ruff / fixit lack, and Python linters lack or are too slow).
-
Rye: A Vision Continued
I think it’s interesting that rye uses ruff (https://github.com/astral-sh/ruff) for linting and formatting. That’s the right call, and it’s also correct to bundle that in for an integrated dev experience.
I had to guess, that’s the path that the Astral team would take as well - expand ruff’s capabilities so it can do everything a Python developer needs. So the vision that Armin is describing here might be achieved by ruff eventually. They’d have an advantage that they’re not a single person maintenance team, but the disadvantage of needing to show a return to their investors.
- An fast Python linter and code formatter, written in Rust
-
Smooth Packaging: Flowing from Source to PyPi with GitLab Pipelines
Adding more weight to ease of setup and configurability, the choice came down on flake8. It is easy to integrate, since its also available through pip and let’s you configure which standards you want to omit by simply stating them as a list via the --ignore switch. Moving to ruff appears quite smooth, so future updates may do so.
- Show HN: Marimo – an open-source reactive notebook for Python
-
AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
I confess I stole the pip recipe from Charlie :D
https://github.com/astral-sh/ruff/blob/main/.github/workflow...
-
Embracing Modern Python for Web Development
Ruff is an emerging tool in the Python ecosystem that describes itself as "an extremely fast Python linter and code formatter, written in Rust".
- Ruff: An fast Python linter and code formatter, written in Rust
flake8
-
How I start every new Python backend API project
repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - id: trailing-whitespace - id: check-merge-conflict - id: check-yaml args: [--unsafe] - id: check-json - id: detect-private-key - id: end-of-file-fixer - repo: https://github.com/timothycrosley/isort rev: 5.10.1 hooks: - id: isort - repo: https://github.com/psf/black rev: 22.8.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 rev: 3.9.2 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.971 hooks: - id: mypy args: [ --warn-unused-configs, --ignore-missing-imports, --disallow-untyped-defs, --follow-imports=silent, --install-types, --non-interactive ]
-
Flake8 took down the gitlab repository in favor of github
I just ran `pre-commit autoupdate`. It's asking for a username for https://gitlab.com/pycqa/flake8. :-(
-
flake8-length: Flake8 plugin for a smart line length validation.
Flake8 plugin for a smart line length validation.
-
Should I follow the warnings in Pycharm? Does anyone do this?
repo: https://gitlab.com/pycqa/flake8 rev: 3.9.2 hooks:
-
flake8-pylint: Flake8 plugin that runs PyLint
Flake8 plugin that runs PyLint.
- Ask HN: Did somebody have success with the migration of Python 2.7 to Java/C#?
-
Make your Django project newbie contributor friendly with pre-commit
$ pre-commit install pre-commit installed at .git/hooks/pre-commit $ git add .pre-commit-config.yaml $ git commit -m "Add pre-commit config" [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://gitlab.com/pycqa/flake8. [INFO] Initializing environment for https://github.com/pycqa/isort. [INFO] Initializing environment for https://github.com/python/black. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://gitlab.com/pycqa/flake8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pycqa/isort. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/python/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... Trim Trailing Whitespace.................................................Passed Check Yaml...............................................................Passed Check for merge conflicts................................................Passed Debug Statements (Python)............................(no files to check)Skipped Check for added large files..............................................Passed Fix requirements.txt.................................(no files to check)Skipped Check django project for potential problems..........(no files to check)Skipped Check django project for missing migrations..........(no files to check)Skipped flake8...............................................(no files to check)Skipped isort................................................(no files to check)Skipped black................................................(no files to check)Skipped
-
On unit testing
If you're looking for just good automated error checking, I personally use a bunch of flake8 plugins via pre-commit hooks: flake8-bugbear, flake8-builtins, flake8-bandit, etc. You can find a bunch of sites that give recommended plugins and you just need to pick which ones you care about :)
-
Python: Setting Up Project Environment
flake8 is Python style checker based on PEP8(Python Enhance Proposal 8). black is a good code formatter. But some items such as Documentation String, black is not provided the check option. flake8 not only helps for lack of black but also can be easily applied with black.
What are some alternatives?
black - The uncompromising Python code formatter
pyright - Static Type Checker for Python
mypy - Optional static typing for Python
black - The uncompromising Python code formatter [Moved to: https://github.com/psf/black]
yapf - A formatter for Python files
Pylint - It's not just a linter that annoys you!
pyre-check - Performant type-checking for python.
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.
pre-commit - A framework for managing and maintaining multi-language pre-commit hooks.