-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: make sure local ruff runs don't touch vendored #618
Conversation
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #618 +/- ##
=======================================
Coverage 71.03% 71.03%
=======================================
Files 13 13
Lines 1084 1084
=======================================
Hits 770 770
Misses 314 314 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
We already have this in place which makes this PR redundant. |
Nope. it's not redundant. It's set for pre-commit, but not for standalone ruff runs. |
Why not just do |
Because I simply run ruff. |
Well, you could just as easily run |
Yet, I do have |
How so? |
Are you sure you're running the same version in both cases? |
Of course. It's just that pre-commit skips vendored, while standalone ruff does not. |
It’s hard to add flags when running pre-commit, like --unsafe-fixes, so it’s handy to run locally sometimes. Unlike flake8, there’s no variations based on what else is installed, so it’s safe to run it outside pre-commit’s venvs. Though if all you want to do is run it only with no special flags, I would recommend |
Oh, that's the only thing you meant by results not being consistent? |
Ah...that's a valid argument. Yeah, I don't see a way to pass flags through |
I tend to avoid pre-commit, it doesn't work well outside containers and virtualenvs on older Linux distributions, typically the oldest still maintained Ubuntu LTS. |
It's useful to run ruff locally sometimes, like to add
--unsafe-fixes
. This ensures it doesn't format or change something it shouldn't. See #617.