Skip to content

RUF005: Use the unpacking operator to concatenate collections #2869

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 14, 2023

Conversation

seisman
Copy link
Member

@seisman seisman commented Dec 11, 2023

Description of proposed changes

This PR fixes some errors reported by ruff's RUF005 rule. See https://docs.astral.sh/ruff/rules/collection-literal-concatenation/ for the explanations about RUF005.

The changes in this PR are made by running the following command:

ruff check pygmt examples --extend-select=RUF005 --unsafe-fixes --fix

@seisman seisman added maintenance Boring but important stuff for the core devs needs review This PR has higher priority and needs review. labels Dec 11, 2023
@seisman seisman added this to the 0.11.0 milestone Dec 11, 2023
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

So far, the related group of rules RUF (please see the last bullet point of the list in #2741 (comment)) is not enabled in the project.toml at:

pygmt/pyproject.toml

Lines 100 to 116 in d460b07

[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"E", # pycodestyle
"F", # pyflakes
"FA", # flake8-future-annotations
"FLY", # flynt
"I", # isort
"ISC", # flake8-implicit-str-concat
"NPY", # numpy
"PD", # pandas-vet
"PIE", # flake8-pie
"PL", # pylint
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]

Is this because the required adjustments to follow all RUF related rules are spread over multiple PRs (see also PR #2871) and we will enable it in the last PR for this group of rules? Or do we only want to follow RUF005 and RUF010 (I did not look up the other rules in detail)?

@seisman
Copy link
Member Author

seisman commented Dec 13, 2023

yes, I plan to enable the RUL rules in a later PR.

@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Dec 14, 2023
@seisman seisman merged commit b03fcc7 into main Dec 14, 2023
@seisman seisman deleted the ruff/RUF005 branch December 14, 2023 08:57
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Boring but important stuff for the core devs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants