Skip to content

Conversation

@DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented Jun 12, 2025

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/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Jun 12, 2025
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as draft June 12, 2025 22:14
@dstansby
Copy link
Contributor

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?

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented Jun 18, 2025

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?

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the sourcery branch 12 times, most recently from bec6be5 to 7270dd1 Compare June 26, 2025 20:10
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the sourcery branch 3 times, most recently from f55e79a to 5a1df20 Compare July 7, 2025 21:10
@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.74%. Comparing base (fe42655) to head (ce0a3ac).

Files with missing lines Patch % Lines
src/zarr/core/group.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3131   +/-   ##
=======================================
  Coverage   61.74%   61.74%           
=======================================
  Files          85       85           
  Lines       10179    10169   -10     
=======================================
- Hits         6285     6279    -6     
+ Misses       3894     3890    -4     
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%) ⬇️
src/zarr/core/buffer/core.py 30.98% <ø> (ø)
src/zarr/core/buffer/cpu.py 37.25% <ø> (-0.93%) ⬇️
src/zarr/core/dtype/common.py 27.71% <100.00%> (ø)
src/zarr/core/metadata/v2.py 58.13% <100.00%> (ø)
src/zarr/testing/stateful.py 98.84% <100.00%> (ø)
src/zarr/testing/store.py 75.00% <ø> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the sourcery branch 2 times, most recently from 58a885b to ae772b5 Compare July 12, 2025 11:08
@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review July 12, 2025 11:09
@DimitriPapadopoulos DimitriPapadopoulos force-pushed the sourcery branch 2 times, most recently from 679e33e to 6c9c486 Compare August 6, 2025 07:09
@DimitriPapadopoulos DimitriPapadopoulos changed the title Apply Sourcery suggestions and fix typos Apply more ruff rules Aug 6, 2025
@DimitriPapadopoulos DimitriPapadopoulos changed the title Apply more ruff rules Apply ruff preview rule Aug 6, 2025
Disable rules that:
- we don't want to fix,
- have been implemenetd in ruff,
- could be enabled later and are currently followed by `FIXME`.
FURB140 Use `itertools.starmap` instead of the generator
Unnecessary ellipsis constant
@DimitriPapadopoulos DimitriPapadopoulos changed the title Apply ruff preview rule Enforce Pylint rules Oct 26, 2025
@DimitriPapadopoulos
Copy link
Contributor Author

I have added Pylint to CI.

Adding it to pre-commit is discouraged because it is slow and incompatible with pre-commit parallelisation:

Useless parent or super() delegation in method '__init__'
Reimport 'ArrayV3Metadata'
Unnecessary parens after 'not' keyword
Do not raise StopIteration in generator, use return statement instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants