-
Notifications
You must be signed in to change notification settings - Fork 49
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
Initial setup of QA pre-commit tools [cf-units] #522
Initial setup of QA pre-commit tools [cf-units] #522
Conversation
addressed in this branch
existing known Deprecation warnings
- Required lots of additions to the Ruff ignore list - Extra additions to mypy ignore list - Autofixes from Ruff linter - Fixes from codespell
- Removed some duplicate ruff ignores - Reorded some subsections
- Added: `force-sort-within-sections = true` - Auto updated files resultig from above - file specific ignores
- Trailing witespace - No neline at end of file - Some Ruff linting
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #522 +/- ##
==========================================
- Coverage 58.41% 58.40% -0.02%
==========================================
Files 62 62
Lines 6435 6433 -2
Branches 1150 1150
==========================================
- Hits 3759 3757 -2
Misses 2385 2385
Partials 291 291 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
- Add trailing / to mypy exclude paths
Added extra ignores in mypy for _udunits generated code
Re-added PY005 test to sp-repo-review ignore list.
@pp-mo I Have resolved the issues I was having with pre-commit.ci. I have reinstated the The MyPy behaviour was more difficult to debug. It turns out that adding files to the MyPy There is a flag that can be passed to stop this
The combination of the above fix the errors on my personal laptop and the pre-commit.ci service, so this is ready for review now. I don't know why the behaviour is different on the MO VDIs though (pre-commit and hook version numbers are same!) |
I don't think turning this totally off is a good idea, anyway. |
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.
Ok but a few nit-picky suggestions.
You should also create some PRs to track unfinished business.
Suggest one each for :
- re-order pre-commit entries based on updated tempate file : (can do this one right now)
- mypy
- ruff
- numpydocs-validation
I've already created Issues for these (not PRs), see links in description
Done; see d831bfb |
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.
I think removing "D212" from the ruff.lint select
is worth doing,
not least because the comment is confusing + I think wrong!
otherwise all looks great now + good to go !
This also updated one docstring in cf_units/__init__.py (correctly) due to the removal of a redundant `noqa: E501` marker in a previous commit
Right - |
🚀 Pull Request
Description
Added following pre-commit hooks:
sp-repo-review
was already setup for cf-units, but have updated the ignore list as various tests now pass.ruff
was enabled, but with only selected tests. Have enabled "all" tests.For all QA tools above, the results of any "auto-fixes" have been included in this repo, mainly fixes for:
All other failing tests have been added to ignore lists. See separate issues: