Visitar URL original
Add `flake8` extensions by namurphy · Pull Request #1777 · PlasmaPy/PlasmaPy · GitHub
Skip to content

Add flake8 extensions - #1777

Merged
StanczakDominik merged 8 commits into
PlasmaPy:mainfrom
namurphy:flake8-extensions
Nov 2, 2022
Merged

StanczakDominik merged 8 commits into
PlasmaPy:mainfrom
namurphy:flake8-extensions

Conversation

@namurphy

@namurphy namurphy commented Oct 31, 2022 •

Copy link
Copy Markdown
Member

This PR adds the following flake8 extensions:

  • flake8-useless-assert — to make sure that assert statements won't always pass or fail
  • flake8-use-pathlib — to enforce recommend usage of pathlib
  • flake8-builtins — to avoid name conflicts with Python builtins (like min and max)
  • flake8-comments — to avoid redundant comments

This PR also makes a few minor edits in order for the new flake8 extensions to pass.

Before merging, I'll need to:

  • Test the plasma calculator

@github-actions github-actions Bot added plasmapy.analysis Related to the plasmapy.analysis subpackage plasmapy.plasma Related to the plasmapy.plasma subpackage plasmapy.utils Related to the plasmapy.utils subpackage labels Oct 31, 2022
@github-actions

Copy link
Copy Markdown

Thank you for contributing to PlasmaPy! The project's future depends deeply on contributors like you, so we deeply appreciate it! 🌱 The following checklist will be used by the code reviewer to help guide the code review process.

  • Overall
    • Does the PR do what it intends to do?
    • Except for very minor changes, is a changelog entry included and consistent with the changelog guide?
    • Are the continuous integration checks passing? (Most linter problems can be automagically fixed by commenting on this PR with pre-commit.ci autofix.)
  • Code
    • Is new/updated code understandable and consistent with the coding guide?
    • Are there ways to greatly simplify the implementation?
    • Are there any large functions that should be split up into shorter functions?
  • Tests
    • Are tests added/updated as required, and consistent with the testing guide?
    • Are the tests understandable?
    • Do the tests cover all important cases?
  • Docs
    • Are docs added/updated as required, and consistent with the doc guide?
    • Are the docs understandable?
    • Do the docs show up correctly in the preview, including Jupyter notebooks?

@namurphy

Copy link
Copy Markdown
Member Author

The doc build failure is unrelated.

@namurphy

namurphy commented Nov 1, 2022 •

Copy link
Copy Markdown
Member Author

I dropped flake8-useless-assert since it has a flake8 < 5.0 requirement that led to a dependency conflict. Assertions that will be always True or False should be caught by other tools though...for example by periodic automated Sourcery refactorings.

These kwargs match the kwargs needed for an external call, so it's
probably okay to mirror the builtins names' this time.
@codecov

codecov Bot commented Nov 1, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 98.36% // Head: 98.36% // No change to project coverage 👍

Coverage data is based on head (b7b86b3) compared to base (7fdbc50).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1777   +/-   ##
=======================================
  Coverage   98.36%   98.36%           
=======================================
  Files          86       86           
  Lines        8176     8176           
=======================================
  Hits         8042     8042           
  Misses        134      134           
Impacted Files Coverage Δ
plasmapy/analysis/swept_langmuir/helpers.py 100.00% <ø> (ø)
plasmapy/plasma/sources/plasmablob.py 100.00% <ø> (ø)
plasmapy/utils/decorators/validators.py 100.00% <ø> (ø)
plasmapy/utils/data/downloader.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@namurphy
namurphy marked this pull request as ready for review November 1, 2022 21:05
@namurphy
namurphy requested review from a team and rocco8773 as code owners November 1, 2022 21:05
@StanczakDominik
StanczakDominik merged commit 95a92fd into PlasmaPy:main Nov 2, 2022
@namurphy
namurphy deleted the flake8-extensions branch November 2, 2022 13:23
@namurphy namurphy added the linters Code linters and autoformatters label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linters Code linters and autoformatters plasmapy.analysis Related to the plasmapy.analysis subpackage plasmapy.plasma Related to the plasmapy.plasma subpackage plasmapy.utils Related to the plasmapy.utils subpackage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants