-
Notifications
You must be signed in to change notification settings - Fork 12
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
style: Perform full linting and fixes to the whole codebase #124
Conversation
Remove uneeded shell check precommit. Update codespell settings to use a whitelist of words. Perform spell checking and fixes.
* style: Update line length config and fix E501 errors Line length configuration for linting is increased to 100 in 'pyproject.toml' with 'ruff'. Performed E501 fixes for anything that is > 100 line length. This fixes include some places to have 'noqa: E501' flag. * style: Fix eof line .codespell-whitelist
* style: Remove * imports, fixes F403 PEP violation Update all * imports to be more explicit of the classes/functions being imported, which fixes PEP8 F403 violation. * style: Expand imports for data module
Fixes all undefined variables violation of PEP8 F821. Also modified to fix other linting issues.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #124 +/- ##
==========================================
+ Coverage 88.70% 88.74% +0.04%
==========================================
Files 36 36
Lines 1885 1901 +16
==========================================
+ Hits 1672 1687 +15
- Misses 213 214 +1 ☔ View full report in Codecov by Sentry. |
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 see a lot of from x import *
are removed, which is fine in general. However it means that maintenance is more work since any new function must be traced through the import hierarchy and added to all the imports and __all__
's. What is the benefit of doing things this way?
Great question @ConnorStoneAstro! PEP8 Standard states the following:
This is typically not a recommended way to import functions and classes as it is very implicit and hard to understand what is actually being imported. One great article that really hammer on this ambiguity can be found at: https://internetworking.dev/why-it-is-bad-idea-to-use-wildcard-based-imports/
To this point, really what you need is to import any new public functions in a module to the module's Normally when programming Python it is always better to be explicit rather than implicit to avoid any confusions, hence their PEP8 above. |
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.
This looks great!
Lint and fix the entire codebase to follow the PEP8 Guidelines. Currently the only one check that is turned off is the mypy, which fixes will happen in a separate PR. Pre-commit CI check should now pass.