[image] felix:
apply plugin: ‘com.palantir.transforms.lang.format-code-ruff’
+1 to @A_Klapp 's point. It would be nice to configure what happens during “Alt-Shift-F”. in my experience, I found that Ruff or Black formatters mismatch what Alt-Shift-F does in major two ways:
only Alt-Shift-F d… Answer from Yurii.Mashtalir on community.palantir.com
GitHub
github.com › astral-sh › ruff-pre-commit
GitHub - astral-sh/ruff-pre-commit: A pre-commit hook for Ruff. · GitHub
A pre-commit hook for Ruff. Contribute to astral-sh/ruff-pre-commit development by creating an account on GitHub.
Starred by 1.9K users
Forked by 99 users
Languages Python
Astral
docs.astral.sh › ruff › integrations
Integrations | Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.15.12 hooks: # Run the linter. - id: ruff-check # Run the formatter.
Ruff code formatter and pre-commit hooks
We are interrested to implement a code formatting and check through Ruff. Does a template or any example of Ruff setup over a code repository exist ? Does AIP assist would be able to bring some formatting rules through code sample ? Does pre-commit hooks can be implemented to ensure that a ... More on community.palantir.com
How to use Ruff?
You run it separately until you develop a set of rules you are comfortable with it enforcing, and a subset you are comfortable with it fixing. Given that any decent IDE will integrate it, I would assume it's very rare that any developer ever runs it manually. More on reddit.com
python poetry - Running git commit is not properly running pre-commit hooks - Stack Overflow
I'm currently using Ruff and am using pre-commit hooks to run it with configuration info in .pre-commit-config.yaml and .ruff.toml. When I run pre-commit run --all-files the rules like isort run fi... More on stackoverflow.com
5 Pre-Commit Hooks Every Data Engineer Should Know
Great share for people not in the know. I will say I used all of these until last year when ruff matured. Nearly all the python focused hooks can be replaced with just ruff and the proper ruff features enabled. More on reddit.com
Videos
04:45
Boost Your Python Code Quality: Pre-commit Tutorial (UV & Ruff) ...
Increase Python code quality with pre-commit
35:47
Python Tutorial: Ruff - A Fast Linter & Formatter to Replace Multiple ...
02:13
Precommit Hooks Are Always Bad - YouTube
YouTube
15:16
Boost Your Coding Efficiency with Git Pre-Commit Hooks - YouTube
Reddit
reddit.com › r/learnpython › how to use ruff?
r/learnpython on Reddit: How to use Ruff?
February 11, 2026 -
I'm mainly just a hobby programmer but I'm trying to up my CI/CD game. I'm comfortable with mypy and pytest and I'm now looking to integrate ruff. Obviously I know how to launch it, but I'm confused about how its used in practice.
For example, running as:
ruff check ruff format --check
And then manually addressing objections? Or, do you just let ruff make its changes:
ruff check --fix ruff format
...or something else entirely? Thanks.
Top answer 1 of 5
3
You run it separately until you develop a set of rules you are comfortable with it enforcing, and a subset you are comfortable with it fixing. Given that any decent IDE will integrate it, I would assume it's very rare that any developer ever runs it manually.
2 of 5
2
I would just have it fail your pipelines for now. Then later on as you get comfortable with it, you can let it do its thing automatically.
Directed Ignorance
directedignorance.com › blog › ruff-sorting-imports-with-pre-commit
Ruff: Sorting Imports With pre-commit - Directed Ignorance
May 13, 2024 - Sort the Python import mess with the help of Ruff and pre-commit
Stack Overflow
stackoverflow.com › questions › 78753510 › running-git-commit-is-not-properly-running-pre-commit-hooks
python poetry - Running git commit is not properly running pre-commit hooks - Stack Overflow
I'm currently using pre-commit installed with Poetry, and am doing poetry install --with dev to install pre-commit. ... repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.5.0 hooks: # Run the linter. - id: ruff args: [ --fix ] # Run the formatter.
GitHub
github.com › astral-sh › ruff › blob › main › .pre-commit-config.yaml
ruff/.pre-commit-config.yaml at main · astral-sh/ruff
March 17, 2026 - An extremely fast Python linter and code formatter, written in Rust. - ruff/.pre-commit-config.yaml at main · astral-sh/ruff
Author astral-sh
Astral
docs.astral.sh › ruff › tutorial
Tutorial | Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.15.12 hooks: # Run the linter. - id: ruff-check # Run the formatter.
GitHub
github.com › charliermarsh › ruff-pre-commit › blob › main › .pre-commit-hooks.yaml
ruff-pre-commit/.pre-commit-hooks.yaml at main · astral-sh/ruff-pre-commit
A pre-commit hook for Ruff. Contribute to astral-sh/ruff-pre-commit development by creating an account on GitHub.
Author astral-sh
GitHub
github.com › astral-sh › ruff › discussions › 11924
Different results between CLI and Pre-Commit · astral-sh/ruff · Discussion #11924
- repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.4.9 hooks: - id: ruff args: [ --fix ] - id: ruff-format
Author astral-sh
GitHub
github.com › astral-sh › ruff-pre-commit › blob › main › README.md
ruff-pre-commit/README.md at main · astral-sh/ruff-pre-commit
A pre-commit hook for Ruff. Contribute to astral-sh/ruff-pre-commit development by creating an account on GitHub.
Author astral-sh
Reddit
reddit.com › r/dataengineering › 5 pre-commit hooks every data engineer should know
r/dataengineering on Reddit: 5 Pre-Commit Hooks Every Data Engineer Should Know
March 15, 2025 -
Hey All,
Just wanted to share my latest blog about my favorite pre-commit hooks that help with writing quality code.
What are your favorite hooks??
Top answer 1 of 5
56
Great share for people not in the know. I will say I used all of these until last year when ruff matured. Nearly all the python focused hooks can be replaced with just ruff and the proper ruff features enabled.
2 of 5
21
pre-commit hooks are generally an anti-pattern with the exception of secret scanning everything you do in a pre-commit hook has to be done in CI as well anyway to stop people just no-verifying their way around anything they personally hate - and it does happen, in almost every team, every week anything related to formatting should be configured in your editor to be done on save, not a hook, then added to CI so any PRs failing can be a trigger to get your devs to sort their editors out
Stack Overflow
stackoverflow.com › questions › 78637149 › different-results-between-cli-and-pre-commit
python - Different results from Ruff between CLI and pre-commit hook - Stack Overflow
Pre-commit runs only on the files in the git repo. So if a.py was not added to git, then it's only checked by ruff check and not pre-commit.
Principles of Visualization
ericmjl.github.io › blog › 2023 › 10 › 9 › its-time-to-upgrade-to-ruff
It's time to upgrade to Ruff - Eric J. Ma's Personal Site
October 9, 2023 - Pre-commit hooks are beneficial to ensure that the checks run automatically before your code gets committed, ensuring its quality. ... - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version.
GitHub
github.com › pwr-Solaar › Solaar › issues › 2295
Switch pre-commit hooks to ruff (100x faster pre-commit, updated code style) · Issue #2295 · pwr-Solaar/Solaar
February 17, 2024 - Unique formatting of code and linting is enforced by CI checks using a pre-commit hook with yapf, isort and flake8. Especially, the yapf code formatter and flake8 linter are slow compared to modern tools. This renders yapf ... Describe the solution you'd like The fastest Python code formatter on the market is currently ruff format, which is 100x faster than yapf.
Author MattHag
PyPI
pypi.org › project › ruff › 0.0.191
ruff · PyPI
Setting force-exclude = true will cause Ruff to respect these exclusions unequivocally. This is useful for pre-commit, which explicitly passes all changed files to the ruff-pre-commit plugin, regardless of whether they're marked as excluded by Ruff's own settings.
» pip install ruff
Published Dec 22, 2022
Version 0.0.191
jmanteau
jmanteau.fr › posts › moving-to-a-new-python-tooling-stack-ruff-pre-commit
Moving to a New Python Tooling Stack: Ruff & Pre-Commit - jmanteau
November 23, 2023 - TL;DR: Ruff combines different tools like linters, security analyzers, and formatters into one unique simple fast tool with a standard configuration. Pre-commit streamlines git pre-commit hooks by standardizing configurations and offering community-made hooks.