Enforce Pylint rules
~~Also a couple Pylint rules that may not yet be implemented in ruff.~~
Edit: Run Pylint in addition to ruff, because not all Pylint rules have been or can be implemented in ruff.
TODO:
- [ ] Add unit tests and/or doctests in docstrings
- [ ] Add docstrings and API docs for any new/modified user-facing classes and functions
- [ ] New/modified features documented in
docs/user-guide/*.rst - [ ] Changes documented as a new file in
changes/ - [x] GitHub Actions have all passed
- [x] Test coverage is 100% (Codecov passes)
I'm 👍 for spelling fixes, and 👎 for refactoring without a linter doing it automatically for us (because it just creates PR review noise for not much technical debt reduction). Could you open a PR to repalce this that just includes the spelling fixes?
I think Sourcery applies linter rules, but rules that might not be part of ruff (yet). More importantly, I think Sourcery is a good addition - AI assistance for PR review. But I understand you don't agree with it.
Some of the Sourcery suggestions ~~do improve source code~~ are harmful, such as:
- n_ellipsis = sum(1 for i in selection if i is Ellipsis)
+ n_ellipsis = selection.count(Ellipsis)
How about keeping the couple changes that really make sense?
Codecov Report
:x: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 61.74%. Comparing base (fe42655) to head (adbf3a6).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| src/zarr/core/group.py | 33.33% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #3131 +/- ##
=======================================
Coverage 61.74% 61.74%
=======================================
Files 85 85
Lines 10179 10175 -4
=======================================
- Hits 6285 6283 -2
+ Misses 3894 3892 -2
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/zarr/abc/codec.py | 19.23% <ø> (ø) |
|
| src/zarr/abc/numcodec.py | 15.38% <ø> (ø) |
|
| src/zarr/abc/store.py | 38.29% <ø> (ø) |
|
| src/zarr/codecs/numcodecs/_codecs.py | 37.88% <ø> (-0.58%) |
:arrow_down: |
| src/zarr/core/buffer/core.py | 30.98% <ø> (ø) |
|
| src/zarr/core/dtype/common.py | 27.71% <100.00%> (ø) |
|
| src/zarr/core/metadata/v2.py | 58.13% <100.00%> (ø) |
|
| src/zarr/storage/_zip.py | 72.18% <100.00%> (+0.33%) |
:arrow_up: |
| src/zarr/testing/stateful.py | 98.84% <100.00%> (ø) |
|
| src/zarr/testing/store.py | 75.00% <ø> (ø) |
|
| ... and 1 more |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I have added Pylint to CI.
Adding it to pre-commit is discouraged because it is slow and incompatible with pre-commit parallelisation: