-
Notifications
You must be signed in to change notification settings - Fork 606
MAINT: introduce ruff-check for docstring quality enforcement
#1181
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
Conversation
ruff-check for docstring quality enforcementruff-check for docstring quality enforcement
|
@paulinek13 I love this! A few questions:
|
|
@romanlutz thanks for the questions!
Sorry I forgot to link to my comment that describes what's the plan here: #1176 (comment) 😄 In short, this PR only changes some issues (easy-to-fix issues) and adds them to ruff-check so that future PRs will be scanned for those. Mainly whitespace stuff. Subsequent PRs will address the remaining issues related to the completeness of the public API, each focusing on one (or more) specific pyrit submodule (e.g., And then, when the last module is done, we'll just change the ruff precommit hook to scan whole
✅ It does because the ruff hook currently only checks for issues that have been fixed in this PR
Some issues could be fixed automatically. Example: However, the precommit |
|
I need to read up a little, but perhaps this allows us to get rid of some existing hooks? Between all the linters we have there is probably quite a bit of overlap? |
|
I've removed the pylint hook that was only checking for unused imports so that it's now covered by Ruff’s F401 rule (pylint check took ~15s, now it's less than 1s 🙂). As for an overlap, none of the existing hooks are checking docstring conventions and Ruff is currently only enforcing D*/DOC* rules + unused-imports. So there's no duplication in that sense. From what I've found, other hooks that could be replaced by Ruff in the future are flake8, isort, and possibly black, but I think that switching those over would take a bit more effort and testing to make sure everything behaves the same. |
pyrit/chat_message_normalizer/chat_message_normalizer_tokenizer.py
Outdated
Show resolved
Hide resolved
romanlutz
left a comment
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.
Wonderful! As far as I am concerned, this is ready to merge. Just want to understand a few occurrences better first.

Description
This PR is related to #653 and partially resolves #1176
/pyritruff-checkpre-commit hook to block future PRs from introducing docstring issues that have been fixed in this PR