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

Fix flake8 errors #59

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Fix flake8 errors #59

merged 3 commits into from
Oct 1, 2024

Conversation

mikemhenry
Copy link
Contributor

@mikemhenry mikemhenry commented Sep 30, 2024

Some notes:

  1. I just removed the unused imports that it was complaining about
  2. I fixed the line that was too long by breaking the comment into two lines
  3. I told flake8 to ignore F401 (unused import) on __init__.py files (you can avoid this by using the __all__ = [foo, bar,] dunder but since we don't really export any api in the __init__.py that we would want to not pull in with a * import I opted to just ignore those checks on all __init__.py files)
  4. I added the units it was complaining about to the "builtins" list -- I don't think there is a cleaner way of doing this in flake8. I am not sure how Literal[..] works but flake8 does something to make it work, we may be able to get FloatQuanity to do some magic to make it work the same.

We should make this a required check since when pre-commit fails we either need to fix the errors or tell pre-commit to ignore the error if it is a false positive.

If things have settled enough, all the CI, docs, and pre-commit.ci should be required IMHO

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.40%. Comparing base (da4b80b) to head (5aa6878).
Report is 4 commits behind head on main.

Additional details and impacted files

@mikemhenry mikemhenry changed the title ignore F401 on __init__.py files Fix flake8 errors Sep 30, 2024
@mikemhenry
Copy link
Contributor Author

Once you merge this in, you should be able to update the other PRs and that will fix pre-commit.ci on those PRs as well

Copy link
Contributor

@hannahbaumann hannahbaumann left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @mikemhenry ! Lgtm!

@hannahbaumann hannahbaumann merged commit 33a5cfa into main Oct 1, 2024
9 checks passed
@hannahbaumann hannahbaumann deleted the fix/flake-8-errors branch October 1, 2024 06:50
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.

2 participants