Skip to content

Fixup precommit and update Ruff#16868

Merged
seanbudd merged 12 commits intonvaccess:masterfrom
LeonarddeR:precommitUpdate
Aug 1, 2024
Merged

Fixup precommit and update Ruff#16868
seanbudd merged 12 commits intonvaccess:masterfrom
LeonarddeR:precommitUpdate

Conversation

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR commented Jul 16, 2024

Link to issue number:

Follow up to #16767, #16803
Preparation for #16852

Summary of the issue:

Pre-commit touches several files it shouldn't touch, e.g. symbol dictionaries, translated markdown.

Description of user facing changes

None

Description of development approach

  • Update Ruff to 0.5.2 in requirements
  • Add a hook for scons source
  • Update sconstruct to automatically use the max number of cores when passing -j 0, which can be used with pre-commit to have optimal performance
  • Run pre-commit autoupdate

Note, the following script can be used to perform the actual vfixup that was initially part of this pr, but @seanbudd requested it to be separated.

pre-commit autoupdate
# lint scons files
ruff check --fix
ruff check --add-noqa

# add trailing commas
pre-commit run --all-files add-trailing-comma

# format and re lint
ruff format
ruff check --fix
pre-commit run --all-files

Testing strategy:

  • Test that python file changes will runn checkpot and unit tests (it didn't before)

Known issues with pull request:

None known

Code Review Checklist:

  • Documentation:

    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:

    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:

    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.

  • Security precautions taken.

@LeonarddeR LeonarddeR requested review from a team as code owners July 16, 2024 17:25
Copy link
Copy Markdown
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

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

Do you mind doing the first commit (settings fixup) as a separate PR to the actual fixups (i.e. running this on all files).
It will make reviewing easier.
I'd also like NV Access to be the one to perform the actual fixes, so we don't have to manually review all changes in as much thorough detail, and it is up to date at a point where we can review it

@seanbudd
Copy link
Copy Markdown
Member

seanbudd commented Jul 17, 2024

This diff generally looks fine to me otherwise (i.e. the mass linting is as expected)

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 17, 2024

Walkthrough

The changes involve updating configuration files to align with pre-commit expectations. Specifically, the .pre-commit-config.yaml file is updated to exclude the user_docs directory and refine hook configurations, while the requirements.txt file updates the ruff package to version 0.5.2.

Changes

Files Change Summary
.pre-commit-config.yaml Added exclusion pattern for user_docs, updated hooks for trailing-whitespace and end-of-file-fixer, updated ruff-pre-commit revision to v0.5.2, refined file types checked by certain hooks.
requirements.txt Updated ruff package from version 0.4.10 to 0.5.2.

Assessment against linked issues

Objective Addressed Explanation
Format the docs according to pre-commit expectations (#16852)
Exclude docs from pre-commit (#16852)

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit 8bb1c397a9

@LeonarddeR LeonarddeR mentioned this pull request Jul 17, 2024
5 tasks
@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit 04ee2c6c95

Copy link
Copy Markdown
Member

@Qchristensen Qchristensen left a comment

Choose a reason for hiding this comment

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

UserGuide looks fine, just removed the spaces between the issue number and the comma

Co-authored-by: Quentin Christensen <quentin@nvaccess.org>
@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

thanks @Qchristensen

@LeonarddeR LeonarddeR requested a review from seanbudd July 18, 2024 07:44
@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit 0a6a380115

LeonarddeR and others added 6 commits July 19, 2024 07:48
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…eated, otherwise we can't run a license check for changed requirements
Co-authored-by: Sean Budd <seanbudd123@gmail.com>
@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit a9c40289bd

@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit 15fe6b66e2

@seanbudd seanbudd added the conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review. label Jul 30, 2024
@LeonarddeR LeonarddeR requested a review from Qchristensen July 30, 2024 17:35
@AppVeyorBot
Copy link
Copy Markdown

See test results for failed build of commit e579ec6721

@seanbudd
Copy link
Copy Markdown
Member

I'll be merging this tomorrow morning AEST

@seanbudd seanbudd merged commit ae14d3d into nvaccess:master Aug 1, 2024
@LeonarddeR
Copy link
Copy Markdown
Collaborator Author

I noticed that the -0 trick actually doesn't work, since as soon as you override a command line option, you can't set it with SetOption. See SCons/scons#3937

seanbudd pushed a commit that referenced this pull request Aug 2, 2024
Fixup for #16868

Summary of the issue:
As part of #16868, i intended to implement support to pass a number of 0 cores to scons (e.g. scons source -j0) to automatically pick all available cores. It turns out that you cant override an option with SetOption when set on the command line.

Description of user facing changes
None, build system related.

Description of development approach
Added an --all-cores parameter that will pick all available cores.
@LeonarddeR LeonarddeR deleted the precommitUpdate branch August 23, 2025 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conceptApproved Similar 'triaged' for issues, PR accepted in theory, implementation needs review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants