8000 MNT: Apply Repo-Review suggestions by DimitriPapadopoulos · Pull Request #1288 · nipy/nibabel · GitHub
[go: up one dir, main page]

Skip to content

MNT: Apply Repo-Review suggestions #1288

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

Merged
merged 1 commit into from
Dec 26, 2023

Conversation

DimitriPapadopoulos
Copy link
Contributor
@DimitriPapadopoulos DimitriPapadopoulos commented Dec 25, 2023

Apply some Repo-Review suggestions.

I went for the low-hanging fruits, other changes are more invasive and deserve a PR of their own, such as using a formatter like ruff of black.

Also update minimal Python version for blue. By the way, isn't blue able to understand requires-python?

Fixed issues

  • MY103: MyPy warn unreachable
    Must have warn_unreachable = true to pass this check. There are occasionally false positives (often due to platform or Python version static checks), so it's okay to ignore this check. But try it first - it can catch real bugs too.
    [tool.mypy]
    warn_unreachable = true
  • MY104: MyPy enables ignore-without-code
    Must have "ignore-without-code" in enable_error_code = [...]. This will force all skips in your project to include the error code, which makes them more readable, and avoids skipping something unintended.
    [tool.mypy]
    enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
  • MY105: MyPy enables redundant-expr
    Must have "redundant-expr" in enable_error_code = [...]. This helps catch useless lines of code, like checking the same condition twice.
    [tool.mypy]
    enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
  • MY106: MyPy enables truthy-bool
    Must have "truthy-bool" in enable_error_code = []. This catches mistakes in using a value as truthy if it cannot be falsey.
    [tool.mypy]
    enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

Issues ignored

Left for later because it requires extensive fixes:

  • MY101: MyPy strict mode
    Must have strict in the mypy config. MyPy is best with strict or nearly strict configuration. If you are happy with the strictness of your settings already, ignore this check or set strict = false explicitly.
    [tool.mypy]
    strict = true

Copy link
codecov bot commented Dec 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f7b9bc4) 92.24% compared to head (1ec8488) 92.24%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1288   +/-   ##
=======================================
  Coverage   92.24%   92.24%           
=======================================
  Files          99       99           
  Lines       12459    12459           
  Branches     2561     2561           
=======================================
  Hits        11493    11493           
  Misses        643      643           
  Partials      323      323           

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

@DimitriPapadopoulos DimitriPapadopoulos force-pushed the repo-review branch 2 times, most recently from ad3aff0 to 10c50af Compare December 25, 2023 23:36
@effigies effigies merged commit 4098598 into nipy:master Dec 26, 2023
@DimitriPapadopoulos DimitriPapadopoulos deleted the repo-review branch December 26, 2023 12:42
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
0