-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
use Ruff for linting #16751
use Ruff for linting #16751
Conversation
See test results for failed build of commit 7db2452973 |
WalkthroughThe project has transitioned from the Flake8 linter to the faster and more comprehensive Ruff linter. This change streamlines the linting process, simplifying configuration files and instructions while improving speed and coverage. Associated documentation and scripts have been updated accordingly. Changes
Sequence Diagram(s)The changes primarily involve configuration and script updates, thus no sequence diagrams are necessary. Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Outside diff range and nitpick comments (7)
projectDocs/dev/codingStandards.md (3)
Line range hint
18-18
: Consider removing the repeated word.The phrase "Indentation must be done with tabs (one per level), not spaces." has a repeated word
Indentation
which could be a typo.- Indentation Indentation must be done with tabs (one per level), not spaces. + Indentation must be done with tabs (one per level), not spaces.
Line range hint
101-101
: Add missing article "the".In the sentence "...consider how the code can be moved in future while retaining backwards compatibility.", "the" is missing before "future."
- ...consider how the code can be moved in future while retaining backwards compatibility. + ...consider how the code can be moved in the future while retaining backwards compatibility.
Line range hint
107-107
: Add missing comma.A comma might be missing after "import time" in the sentence "...code which executes at import time."
- ...code which executes at import time. + ...code which executes at import time,projectDocs/dev/contributing.md (4)
Line range hint
22-22
: Consider rephrasing for standard usage.The phrase "in regards to" is typically considered nonstandard. Consider using "regarding" or "concerning."
- ...considered in regards to implementation, design, and user experience... + ...considered regarding implementation, design, and user experience...
Line range hint
59-59
: Strengthen wording.Consider using a stronger verb than "speed up" in the context of accelerating the review process.
- Being proactive will really help to speed up the process of code review. + Being proactive will greatly accelerate the process of code review.
Line range hint
60-60
: Add missing comma.A comma is missing after "approved" in the sentence "When the PR is approved it will be merged..."
- When the PR is approved it will be merged... + When the PR is approved, it will be merged...
Line range hint
107-107
: Correct verb usage.The word "checkout" is used incorrectly as a verb. It should be "check out."
- Please checkout our [technical design overview](../design/technicalDesignOverview.md). + Please check out our [technical design overview](../design/technicalDesignOverview.md).
See test results for failed build of commit 1632f19c43 |
See test results for failed build of commit 33d993cf79 |
I'm so intensely exited with this pr, congratulations! |
See test results for failed build of commit 57496359fa |
Lint the repository with Ruff This is a follow up for #16751 Must be merge commit not squash merge Using #16751, the following commands were applied: ruff check --fix to apply automatic fixes ruff check --add-noqa to add no-qa comments to all lint failures, so that issues that can't be automatically fixed don't trigger future failures
) Fix up for #16751 Summary of the issue: Ruff recently updated, so we might as well use the latest version. a warning is omitted for the section we added logger-objects to in ruff's config. it was unclear in docs how to avoid pre-commit hooks from triggering. more pre-commit hooks could be added ruff whitespace formating is done through ruff format currently we are only linting with ruff check. We should also run a ruff format on the whole NVDA. ruff was missing scons files, which should also be linted in a mass lint. Summary of other changes: Added pre commit hooks for unit tests and translation comment checks. Added generic pre-commit hooks for python static syntax checking, basic whitespace rules, and file write safety checks change the output of rununittests.bat to have simpler buffer output, only show failures. Ensure the verbose log is logged in AppVeyor. add ruff format to lint checks add scons files to lint checks update coderabbit prompt for change log entry items
run ruff format to fix whitespace changes Follow up to #16767 Closes #12261 Summary of the issue: When migrating to ruff in #16751, we failed to lint scons files, and also run ruff format on the repository. Ruff format fixes whitespaces issues in python files. Description of user facing changes None Description of development approach Perform lint fixes on scons files and run ruff format.
Summary of the issue: The documentation for linting was fragmented. It was not clear why a lint.md file was created as part of #16751 and related changes.. It was probably a result from migrating the Flake8 wiki to the document, and then whittling it down to the point where it became useless. information on how to actually run the linter was missing from it Description of development approach removes lint.md change references to the automated testing doc
Link to issue number:
Fixes #14817
Summary of the issue:
Our linting system has the following issues:
Description of user facing changes
runlint.bat
Description of development approach
To lint the whole code base:
ruff check --fix
to apply automatic fixesruff check --add-noqa
to add no-qa comments to all lint failures, so that issues that can't be automatically fixed don't trigger future failures.git-ignore-blame-revs
See #16752 for an example
Testing strategy:
Known issues with pull request:
Code Review Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores