ci/cd: update workflows, ruff rules and pre-commit hooks #418
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.
1. Add new pre-commits
General purpose
toml-sort
check-merge-conflict
name-tests-test
check-illegal-windows-names
check-case-conflict
These are for release scripts
check-executables-have-shebangs
check-shebang-scripts-are-executable
check-added-large-files
2. Add new ruff rules
New:
ASYNC
#async
calls that do notawait
anything or use blocking methods (link)FA102
# future annotations (link)PTH
# usepathlib
instead ofos
(link)T20
# flake8-print (link)TID
# flake8-tidy-imports (link)Changed
TCH
withTC
(new name for type checking imports) and add it as a safe fixERA
(commented out code) as unfixableIgnore:
E402
on__init__.py
files,tests
anddocs
foldersT20
ontests
anddocs
folders3. Update ruff action to v3
Note
The ruff check on this PR may fail cause of the new rules. I will make a PR with the fixes after this PR is merged (if required)