Skip to content
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

pre-commit linting #248

Merged
merged 3 commits into from
Jul 12, 2024
Merged

pre-commit linting #248

merged 3 commits into from
Jul 12, 2024

Conversation

andrewgsavage
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 95.84158% with 21 lines in your changes missing coverage. Please review.

Project coverage is 95.77%. Comparing base (3d2b16d) to head (9508e02).

Files Patch % Lines
tests/test_uncertainties.py 95.51% 7 Missing ⚠️
tests/test_umath.py 73.68% 5 Missing ⚠️
uncertainties/parsing.py 86.36% 3 Missing ⚠️
tests/helpers.py 92.30% 2 Missing ⚠️
uncertainties/unumpy/core.py 93.75% 2 Missing ⚠️
uncertainties/formatting.py 99.00% 1 Missing ⚠️
uncertainties/ops.py 98.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #248      +/-   ##
==========================================
- Coverage   95.84%   95.77%   -0.08%     
==========================================
  Files          15       15              
  Lines        1927     1916      -11     
==========================================
- Hits         1847     1835      -12     
- Misses         80       81       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andrewgsavage
Copy link
Contributor Author

Most of the diff standardises formatting which it changed automatically. There were a few things which it didn't fix automatically with obvious fixes that I fixed, anything not so obvious I've told the linter to ignore using # noqa

@andrewgsavage
Copy link
Contributor Author

Errors I fixed

tests\helpers.py:349:12: F401 numpy imported but unused; consider using importlib.util.find_spec to test for availability
tests\test_umath.py:224:16: E721 Do not compare types, use isinstance()
tests\test_umath.py:302:9: F841 Local variable err_math_args is assigned to but never used
tests\test_umath.py:315:9: F841 Local variable result is assigned to but never used
tests\test_uncertainties.py:51:5: E722 Do not use bare except
tests\test_uncertainties.py:361:17: E711 Comparison to None should be cond is not None
tests\test_uncertainties.py:394:22: F821 Undefined name random
tests\test_uncertainties.py:464:12: E712 Avoid equality comparisons to True; use if bool(x): for truth checks
tests\test_uncertainties.py:465:12: E712 Avoid equality comparisons to False; use if not bool(y): for false checks
tests\test_uncertainties.py:466:12: E712 Avoid equality comparisons to True; use if bool(z): for truth checks
tests\test_uncertainties.py:467:12: E712 Avoid equality comparisons to True; use if bool(t): for truth checks
tests\test_uncertainties.py:846:12: E721 Do not compare types, use isinstance()
tests\test_uncertainties.py:1054:9: F841 Local variable result is assigned to but never used
tests\test_uncertainties.py:1141:9: F601 Dictionary key literal (3.1415, 0.0001) repeated
tests\test_uncertainties.py:1170:9: F601 Dictionary key literal (12.3, 456.78) repeated
tests\test_uncertainties.py:1202:9: F601 Dictionary key literal (3.1415, 0.0001) repeated
tests\test_uncertainties.py:1212:13: F601 Dictionary key literal 'f' repeated
tests\test_uncertainties.py:1213:13: F601 Dictionary key literal 'F' repeated
tests\test_uncertainties.py:1271:9: F601 Dictionary key literal (1234.56789, 0.1) repeated
tests\test_uncertainties.py:1276:13: F601 Dictionary key literal 'fL' repeated
tests\test_uncertainties.py:1277:13: F601 Dictionary key literal 'FL' repeated
tests\test_uncertainties.py:1282:9: F601 Dictionary key literal (-1.23, 3.4) repeated
tests\test_uncertainties.py:1426:9: F601 Dictionary key literal (12.3, 2.3) repeated
tests\test_uncertainties.py:1560:9: F601 Dictionary key literal (float('-inf'), float('inf')) repeated
tests\test_uncertainties.py:1785:9: F841 Local variable expr is assigned to but never used
uncertainties_init_.py:224:1: F403 from .core import * used; unable to detect undefined names
uncertainties_init_.py:225:19: F401 .core.__all__ imported but unused; consider removing, adding to __all__, or using a redundant alias
uncertainties_init_.py:227:22: F401 .version.__version__ imported but unused; consider removing, adding to __all__, or using a redundant alias
uncertainties\ops.py:417:5: E731 Do not assign a lambda expression, use a def
uncertainties\umath.py:38:1: F403 from .umath_core import * used; unable to detect undefined names
uncertainties\umath_core.py:307:5: E731 Do not assign a lambda expression, use a def
uncertainties\unumpy_init_.py:73:1: F403 from .core import * used; unable to detect undefined names
uncertainties\unumpy_init_.py:74:15: F401 .ulinalg imported but unused; consider removing, adding to __all__, or using a redundant alias
uncertainties\unumpy_init_.py:77:11: F405 core may be undefined, or defined from star imports
uncertainties\unumpy\core.py:597:5: E741 Ambiguous variable name: I
Found 64 errors (29 fixed, 35 remaining).

Copy link
Collaborator

@wshanks wshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, @andrewgsavage. I would like to remove the # noqas by addressing them, but already what is here is an improvement, so I think we can merge this big change for now and come back to the individual linter issues in follow up PRs.

@newville
Copy link
Member

+1 from me. Also, we should ALWAYS ignore alleged failures from codecov. A change in coverage score is not ever a failure that prevents merging. codecov is very, very wrong here.

@andrewgsavage andrewgsavage merged commit 3ef988a into lmfit:master Jul 12, 2024
17 of 19 checks passed
@wshanks
Copy link
Collaborator

wshanks commented Jul 12, 2024

Yes, @newville, I had hoped that #246 was going to remove the ❌ from Codecov on reasonable PRs not affecting coverage much, but it seems like more adjustments to the configuration are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants