OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
791 stars 288 forks source link

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

Closed echoix closed 2 days ago

echoix commented 2 days ago

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 https://github.com/OSGeo/grass/issues/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.