Skip to content
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: modernize Ruff config #148

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

henryiii
Copy link
Contributor

Modernizing the Ruff config a bit. More things are in a .lint namespace now.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@@ -39,7 +35,8 @@ repos:
rev: v0.1.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes, --show-fixes]
- id: ruff-format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the format be before the lint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatter is guaranteed to not add new violations (if not, it's a bug and can be reported), while the linter is not guaranteed to not mess up the format. This is the official recommendation for now, eventually there might be a more elegant solution.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if I run the linter, and the format; wouldn't it mean my linter reports will get reported with bad lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That’s why there will be a better solution in the future. I assume it likely will have to be a way to run both at once. (But that’s a guess)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyproject.toml Outdated
Comment on lines 67 to 69
[tool.ruff.lint]
select = ["ALL"]
isort.required-imports = ["from __future__ import annotations"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly prefer to inline things rather than define new tables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure, per-file-ignores is a separate table already.

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaborbernat gaborbernat merged commit 37dd59e into tox-dev:main Nov 1, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants