-
Notifications
You must be signed in to change notification settings - Fork 160
Update pre-commit configuration, tools and codebase #743
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyupgrade ensures the latest Python syntax supported is used.
check yaml...............................................................Passed fix end of files.........................................................Failed - hook id: end-of-file-fixer - exit code: 1 - files were modified by this hook Fixing packages/solara-widget-manager8/tsconfig.json Fixing packages/solara-widget-manager8/src Fixing packages/solara-widget-manager8/style trim trailing whitespace.................................................Passed pyupgrade................................................................Failed - hook id: pyupgrade - exit code: 1 - files were modified by this hook Rewriting solara/website/pages/doc_use_download.py codespell................................................................Passed ruff.....................................................................Passed ruff-format..............................................................Passed mypy.....................................................................Passed
Use the latest ruff version (v0.6.1) from the current official ruff repo
Fix ruff E721 Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
Fix ruff F811 in solara\toestand.py:148:40: F811 Redefinition of unused `stack` from line 147
Ruff now also works on Jupyter notebooks by default
This reverts commit f530ef8.
Python 3.9 is the lowest version pre-commit supports. See pre-commit/pre-commit#3042
It seems we need to make an exception for Edit: Nevermind, it looks like it just didn't like the Windows line endings. |
Fix: [WARNING] The 'exclude' field in hook 'mypy' is a regex, not a glob -- matching '/*' probably isn't what you want here In regex, `.` matches any character except a newline, and `*` matches zero or more of the preceding element (in this case, any character). `.*` effectively replaces the `/*` glob pattern.
The GitHub Actions workflows also need quite some maintenance, but let's keep this PR focussed on the pre-commit configuration. Ready for review. |
maartenbreddels
approved these changes
Aug 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR performs some maintenance on the pre-commit configuration and codebase to ensure consistency with the latest Python standards and enhanced code quality checks.
Updates include:
pyupgrade
hook: Ensures the code uses the latest Python syntax supported by the project.ruff
hook version: Upgraded to v0.6.1 from the current official repository for better linting capabilities.is
for type comparisons and removed redundant variables, improving overall code readability.ruff
linting to include Jupyter Notebooks by default.check-toml
hook: Ensures TOML files are correctly formatted.mypy
hook: Updated syntax and resolved configuration warnings.All test and pre-commit passes again.
Consider also merging #742 to keep the configuration up to date in the future.
You can squash while merging, but the commit messages actually contain some useful information, so consider not to.