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

STY: Apply ruff/refurb rules #3648

Merged
merged 9 commits into from
May 6, 2024
Merged

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented May 5, 2024

Summary

Partially apply FURB rules, where they make sense, except FURB101 (26 errors), FURB103 (21 errors), FURB113 (2 errors), FURB118 (3 errors), FURB140 (2 errors), FURB171 (25 errors).

List of changes proposed in this PR (pull-request)

  • STY: Apply ruff/refurb rule FURB113
    FURB113 Use list.extend(...) instead of repeatedly calling list.append()
  • STY: Apply ruff/refurb rule FURB129
    FURB129 Instead of calling readlines(), iterate over file object directly
  • STY: Apply ruff/refurb rule FURB136
    FURB136 Replace 20 if len(nodiffidx) >= 20 else len(nodiffidx) with min(20, len(nodiffidx))
  • STY: Apply ruff/refurb rule FURB148
    FURB148 enumerate index is unused, use for x in y instead
  • STY: Apply ruff/refurb rule FURB167
    FURB167 Use of regular expression alias re.X
    FURB167 Use of regular expression alias re.M

Copy link

codecov bot commented May 5, 2024

Codecov Report

Attention: Patch coverage is 21.27660% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 70.90%. Comparing base (d52a62d) to head (7774e3f).

❗ Current head 7774e3f differs from pull request most recent head cfcbc6d. Consider uploading reports for the commit cfcbc6d to get more accurate results

Files Patch % Lines
nipype/interfaces/fsl/model.py 0.00% 21 Missing and 5 partials ⚠️
nipype/interfaces/io.py 25.00% 3 Missing ⚠️
nipype/algorithms/misc.py 0.00% 1 Missing ⚠️
nipype/interfaces/cmtk/nx.py 0.00% 1 Missing ⚠️
nipype/interfaces/dipy/reconstruction.py 0.00% 1 Missing ⚠️
nipype/interfaces/elastix/registration.py 0.00% 0 Missing and 1 partial ⚠️
nipype/interfaces/nipy/preprocess.py 0.00% 1 Missing ⚠️
nipype/pipeline/engine/workflows.py 85.71% 1 Missing ⚠️
nipype/pipeline/plugins/somaflow.py 0.00% 1 Missing ⚠️
nipype/sphinxext/plot_workflow.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3648   +/-   ##
=======================================
  Coverage   70.90%   70.90%           
=======================================
  Files        1277     1277           
  Lines       59477    59455   -22     
  Branches     9819     9824    +5     
=======================================
- Hits        42172    42157   -15     
+ Misses      16134    16122   -12     
- Partials     1171     1176    +5     

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

	 FURB113 Use `list.extend(...)` instead of repeatedly calling `list.append()`
	FURB148 `enumerate` index is unused, use `for x in y` instead
	FURB129 Instead of calling `readlines()`, iterate over file object directly
	FURB167 Use of regular expression alias `re.X`
	FURB167 Use of regular expression alias `re.M`
	FURB136 Replace `20 if len(nodiffidx) >= 20 else len(nodiffidx)` with `min(20, len(nodiffidx))`
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Looks good. A couple small suggestions, but this could go in as-is.

nipype/interfaces/fsl/model.py Outdated Show resolved Hide resolved
nipype/pipeline/engine/workflows.py Outdated Show resolved Hide resolved
nipype/pipeline/engine/workflows.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 4 commits May 6, 2024 10:09
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies effigies merged commit 9f17357 into nipy:master May 6, 2024
15 checks passed
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.

None yet

2 participants