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/pyupgrade rule UP031 #3280

Merged
merged 8 commits into from May 4, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

New in ruff v0.4.2.

Copy link

codecov bot commented May 4, 2024

Codecov Report

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

Project coverage is 73.84%. Comparing base (1e45712) to head (a16071b).

Files Patch % Lines
fmriprep/utils/bids.py 0.00% 2 Missing ⚠️
fmriprep/cli/workflow.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3280   +/-   ##
=======================================
  Coverage   73.84%   73.84%           
=======================================
  Files          56       56           
  Lines        4289     4289           
=======================================
  Hits         3167     3167           
  Misses       1122     1122           

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

@DimitriPapadopoulos
Copy link
Contributor Author

DimitriPapadopoulos commented May 4, 2024

Fixing the ImportError: cannot import name 'get_cmap' from 'matplotlib.cm' CI error requires nipreps/nireports#98.

.maint/paper_author_list.py Outdated Show resolved Hide resolved
.maint/paper_author_list.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 2 commits May 4, 2024 20:43
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
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.

ISC001 should detect and fix them: https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/

Some more suggestions that can't be auto-fixed.

.maint/update_authors.py Outdated Show resolved Hide resolved
fmriprep/cli/parser.py Outdated Show resolved Hide resolved
fmriprep/cli/parser.py Outdated Show resolved Hide resolved
fmriprep/cli/workflow.py Outdated Show resolved Hide resolved
DimitriPapadopoulos and others added 3 commits May 4, 2024 21: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>
@DimitriPapadopoulos
Copy link
Contributor Author

ISC001 should detect and fix them: https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/

Indeed, but ruff format should refrain from creating them when unfolding strings. I'll to reproduce and create a bug report.

@DimitriPapadopoulos
Copy link
Contributor Author

It's a known ruff issue: astral-sh/ruff#9457

In the meantime, there's no better solution than explicitly running ruff check --select ISC001 after ruff format — while the intended order is check before format.

DimitriPapadopoulos and others added 2 commits May 4, 2024 22:05
	ISC001 Implicitly concatenated string literals on one line

This rule is currently disabled because it conflicts with the formatter:
	astral-sh/ruff#8272
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies effigies merged commit 3cbf147 into nipreps:master May 4, 2024
11 of 12 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the UP031 branch May 4, 2024 21:52
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