feat: add pyansys-quality-check hook - #486
Conversation
…s/pre-commit-hooks into feat/pyansys-quality-report
…s/pre-commit-hooks into feat/pyansys-quality-report
|
Just letting you know... I see a lot of overlap with https://github.com/ansys/pre-commit-hooks/blob/main/src/ansys/pre_commit_hooks/tech_review.py Maybe we can try and merge them into the same hook? Probably bringing in whatever is missing from https://github.com/ansys/pre-commit-hooks/blob/main/src/ansys/pre_commit_hooks/tech_review.py into your hook. Or the other way around |
…s/pre-commit-hooks into feat/pyansys-quality-report
…s/pre-commit-hooks into feat/pyansys-quality-report
…s/pre-commit-hooks into feat/pyansys-quality-report
…s/pre-commit-hooks into feat/pyansys-quality-report
…s/pre-commit-hooks into feat/pyansys-quality-report
There was a problem hiding this comment.
Big addition (new quality-report engine plus 12 rule modules), structure is reasonable, but a few things need fixing before merge.
Request (blocking)
-
.pre-commit-hooks.yaml/setup.pyswap out thetech-reviewhook id and console script instead of adding the new one alongside it. Any config pinned toid: tech-reviewbreaks, and this repo's own.pre-commit-config.yaml:62still uses it. Keep the old id/script around (deprecated is fine) or call this an intentional breaking change and update the config. -
project_metadata.py:216,PM010's Poetry-README regex (r"\[^\"']+[\"']") never matches. Tested againstreadme = "README.rst"under[tool.poetry], it returnsNone. Every Poetry project fails this check. Reuse thereadme in contentcheck from the branch below. -
project_metadata.py:346-372,PM014's author/maintainer regexes have no closing bound and bleed fromauthorsintomaintainers. Tested with a wrongauthorsname plus a correctmaintainersblock: bothname_okandemail_okcome backTruefor the wrong author. Bound each regex to its own array, or parse the TOML instead of scanning raw text. -
pyansys_quality_report.py:552-557,check_dirs_existgets called twice with identical args in_bootstrap_legacy_files. Copy-paste leftover, remove the second call.
Suggestion
pyansys_quality_report.py:774,main()swappedparse_args()forparse_known_args(argv), so a typoed flag now gets dropped silently instead of erroring. Keep it strict unless there's a reason not to.security.py:112-131,SEC004passes if just oneuses:line is SHA-pinned anywhere in the workflow. Compare pinned vs. total count instead.- 40+ repeats of "return
Noneif file missing, elsefile_contains" acrossdependabot.py,documentation.py,pre_commit.py,labeler.py,vale.py. Worth achecked_contains()helper incommon.py. test_pyansys_quality_report.py, three testsos.chdir()into a tmp_path and never chdir back, unliketest_tech_review.py's teardown. Can bite later tests depending on run order.
Comment
doc/source/conf.pyhidestech_review.pyfrom autoapi rather than removing or deprecating it. Is it staying as dead code on purpose?
Requesting changes: the regex bugs flip pass/fail on real Poetry and author/maintainer configs, and the hook-id removal breaks this repo's own config.
jorgepiloto
left a comment
There was a problem hiding this comment.
Line-level notes for the earlier review.
| name: "Ansys Technical Review" | ||
| description: "Perform initial technical review on a repository" | ||
| entry: tech-review | ||
| - id: "pyansys-quality-report" |
There was a problem hiding this comment.
Blocking: this replaces the tech-review hook id instead of adding pyansys-quality-report alongside it. setup.py drops the tech-review console script too. Any config pinned to id: tech-review breaks, including this repo's own .pre-commit-config.yaml:62. Keep the old id/script (deprecated is fine) or treat this as an intentional breaking change and update the config.
There was a problem hiding this comment.
Now It is using V8 of pre-commit hook. I have to reformat to local, to replace this new hook. i will do that.
jorgepiloto
left a comment
There was a problem hiding this comment.
I have re-reviewed the updates and most prior threads are now addressed.
I am still seeing one blocking backward-compatibility break: .pre-commit-hooks.yaml now exposes only id: pyansys-quality-report and setup.py exposes only the pyansys-quality-report console script, while this repo and existing consumers still use id: tech-review (for example .pre-commit-config.yaml:62). As written, upgrading to this release will break existing pre-commit configs. I suggest keeping tech-review as a compatibility alias (deprecated is fine) until consumers can migrate safely.
reverted in 9c5d29b |
No description provided.