-
Notifications
You must be signed in to change notification settings - Fork 4
Add support for ruff #82
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
base: main
Are you sure you want to change the base?
Conversation
I'll take a closer look later, but I think it'd make sense to have just one option to specify the ruff config globally and maybe to remove the somewhat opinionated |
I guess that could be added as an additional feature. Several options (like line length) are global and cannot be configured differently for formatter and linter. That's why I think it's better to be able to configure different config files per situation.
Without the default, I guess all possible fixes are applied? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe GitHub's syntax highlighter doesn't like indented code blocks / code blocks in lists? 🤷 In any case, my editor doesn't complain, and neither does mkdocs... |
I'm moving the general docs improvments from this PR to #84 and will rebase once that's merged. |
Co-authored-by: Don Naro <[email protected]>
@gotmax23 can you please take another look? Thanks. |
@@ -78,6 +78,7 @@ class SessionLint(_BaseModel): | |||
|
|||
default: bool = True | |||
extra_code_files: list[str] = [] | |||
ruff_config: t.Optional[p.FilePath] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a global ruff_package option that behaves that has the same overridable behavior as the global ruff_config also makes sense, but other than that, this looks good to me. Thanks!
ruff_autofix_select=( | ||
["I"] if ruff_autofix_select is None else ruff_autofix_select | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff_autofix_select=( | |
["I"] if ruff_autofix_select is None else ruff_autofix_select | |
), | |
ruff_autofix_select=ruff_autofix_select, |
Fixes #70.
ruff check
ruff format
ruff check --fix
CC @gotmax23