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

style(gui): Fixes literal-membership (PLR6201) #3952

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

echoix
Copy link
Member

@echoix echoix commented Jun 30, 2024

Concerns Pylint rule "use-set-for-membership / R6201"

Using ruff check --output-format=concise --select PLR6201 --preview --unsafe-fixes --fix gui/.

Part of the effort to introduce Pylint 3.x for #3921

Uses the fixes provided for ruff rule literal-membership (PLR6201) to fix part of Pylint's "use-set-for-membership / R6201".

I reverted some changes when I wasn't completely sure if the preconditions for this refactor were met, as described in the docs of the rule. One of these is that the objects must be hashable to be in a set. If there are any that you are unsure, I'll simply remove it from the PR, as it isn't exhaustive yet. It still helps to have less linter ignores comments to add afterwards (to have Pylint 3.x not fail).

The changes are limited to gui/wxpython to limit the review scope.

Concerns Pylint rule "use-set-for-membership / R6201"

Using `ruff check --output-format=concise --select PLR6201 --preview --unsafe-fixes --fix gui/`.
@echoix echoix added this to the 8.5.0 milestone Jun 30, 2024
@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Jun 30, 2024
@echoix echoix changed the title style(gui/wxpython): Fixes literal-membership (PLR6201) style(gui): Fixes literal-membership (PLR6201) Jun 30, 2024
@echoix echoix enabled auto-merge (squash) June 30, 2024 23:41
@echoix echoix merged commit 2ae07bc into OSGeo:main Jul 1, 2024
26 of 29 checks passed
@echoix echoix deleted the fix-literal-membership-gui-wxpython branch July 1, 2024 00:30
cyliang368 pushed a commit to cyliang368/grass that referenced this pull request Jul 1, 2024
* style(gui/wxpython): Fixes literal-membership (PLR6201)

Concerns Pylint rule "use-set-for-membership / R6201"

Using `ruff check --output-format=concise --select PLR6201 --preview --unsafe-fixes --fix gui/`.

* style: Apply single element in set formatting
@a0x8o a0x8o mentioned this pull request Jul 1, 2024
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 2, 2024
* style(gui/wxpython): Fixes literal-membership (PLR6201)

Concerns Pylint rule "use-set-for-membership / R6201"

Using `ruff check --output-format=concise --select PLR6201 --preview --unsafe-fixes --fix gui/`.

* style: Apply single element in set formatting
a0x8o pushed a commit to a0x8o/grass that referenced this pull request Jul 23, 2024
* style(gui/wxpython): Fixes literal-membership (PLR6201)

Concerns Pylint rule "use-set-for-membership / R6201"

Using `ruff check --output-format=concise --select PLR6201 --preview --unsafe-fixes --fix gui/`.

* style: Apply single element in set formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants