chore: make sure local ruff runs don't touch vendored by henryiii · Pull Request #618 · pypa/wheel (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation19 Commits4 Checks16 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

henryiii

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.

@henryiii

Signed-off-by: Henry Schreiner henryschreineriii@gmail.com

@codecov Codecov

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.03%. Comparing base (78b9ea9) to head (74c0d54).
Report is 7 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

@DimitriPapadopoulos

I suggest you remove this:

[tool.black]
extend-exclude = '''
^/src/wheel/vendored/
'''

It had been forgotten when shifting from black to ruff in 83b77e5.

DimitriPapadopoulos

@henryiii

agronholm

@henryiii @agronholm

Co-authored-by: Alex Grönholm alex.gronholm@nextday.fi

@agronholm

We already have this in place which makes this PR redundant.

@DimitriPapadopoulos

Nope. it's not redundant. It's set for pre-commit, but not for standalone ruff runs.

@agronholm

Why not just do pre-commit run -a?

@DimitriPapadopoulos

Because I simply run ruff.

@agronholm

Well, you could just as easily run pre-commit run -a ruff, no need to even install ruff explicitly?

@DimitriPapadopoulos

Yet, I do have ruff installed. When I run ruff, results are not consistent with pre-commit.

@agronholm

@agronholm

Are you sure you're running the same version in both cases?

@DimitriPapadopoulos

Of course. It's just that pre-commit skips vendored, while standalone ruff does not.

@henryiii

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 pre-commit run -a ruff.

@agronholm

Of course. It's just that pre-commit skips vendored, while standalone ruff does not.

Oh, that's the only thing you meant by results not being consistent?

@agronholm

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 pre-commit run -a ruff.

Ah...that's a valid argument. Yeah, I don't see a way to pass flags through pre-commit run. When I needed to use --unsafe-fixes, I just temporarily added that flag to .pre-commit-config.yaml.

@DimitriPapadopoulos

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.

@agronholm

@henryiii henryiii deleted the henryiii/chore/ruffex branch

August 4, 2024 14:11