Closed jGaboardi closed 4 months ago
Running ruff check fastpair
with the following rules (standard in the PySAL ecosystem):
lint.select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
results in:
fastpair/__init__.py:2:1: UP009 [*] UTF-8 encoding declaration is unnecessary
fastpair/__init__.py:16:19: F401 `.base.FastPair` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
fastpair/base.py:2:1: UP009 [*] UTF-8 encoding declaration is unnecessary
fastpair/base.py:36:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `division`, `print_function` for target Python version
fastpair/base.py:36:1: I001 [*] Import block is un-sorted or un-formatted
fastpair/base.py:38:22: F401 [*] `operator.itemgetter` imported but unused
fastpair/base.py:46:7: N801 Class name `attrdict` should use CapWords convention
fastpair/base.py:50:14: UP008 Use `super()` instead of `super(__class__, self)`
fastpair/base.py:54:16: UP004 [*] Class `FastPair` inherits from `object`
fastpair/base.py:77:23: C408 Unnecessary `list` call (rewrite as a literal)
fastpair/base.py:101:21: F841 Local variable `res` is assigned to but never used
fastpair/base.py:119:16: E713 [*] Test for membership should be `not in`
fastpair/base.py:120:28: UP032 [*] Use f-string instead of `format` call
fastpair/base.py:124:16: E713 [*] Test for membership should be `not in`
fastpair/base.py:125:28: UP032 [*] Use f-string instead of `format` call
fastpair/test/test_fastpair.py:2:1: UP009 [*] UTF-8 encoding declaration is unnecessary
fastpair/test/test_fastpair.py:13:1: UP010 [*] Unnecessary `__future__` imports `absolute_import`, `division`, `print_function` for target Python version
fastpair/test/test_fastpair.py:13:1: I001 [*] Import block is un-sorted or un-formatted
fastpair/test/test_fastpair.py:17:44: F401 [*] `itertools.groupby` imported but unused
fastpair/test/test_fastpair.py:23:32: F401 [*] `scipy.unique` imported but unused
fastpair/test/test_fastpair.py:66:21: B905 [*] `zip()` without an explicit `strict=` parameter
fastpair/test/test_fastpair.py:82:5: N802 Function name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:99:26: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:106:24: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:117:24: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:130:24: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:137:29: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:144:42: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:153:38: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:171:44: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:179:9: E741 Ambiguous variable name: `l`
fastpair/test/test_fastpair.py:187:28: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:212:33: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:223:9: E741 Ambiguous variable name: `l`
fastpair/test/test_fastpair.py:224:9: F841 Local variable `res` is assigned to but never used
fastpair/test/test_fastpair.py:225:9: F841 Local variable `neigh` is assigned to but never used
fastpair/test/test_fastpair.py:270:25: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:280:13: F841 Local variable `myitem` is assigned to but never used
fastpair/test/test_fastpair.py:290:45: N803 Argument name `PointSet` should be lowercase
fastpair/test/test_fastpair.py:298:9: F841 Local variable `res` is assigned to but never used
There are actually far fewer linting issues than I anticipated and - from what I can tell - all are trivial fixes. Great job at writing future-proof code @carsonfarmer !
Attention: Patch coverage is 91.66667%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 99.2%. Comparing base (
3d082b4
) to head (7383b93
).
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
utilizing
ruff
for formatting & linting – #20base.py