OSGeo / grass

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

style: Fixes unnecessary-collection-call (C408) for remaining code #3948

Closed echoix closed 2 days ago

echoix commented 2 days ago

Only applies fixes to non-empty collections by ruff check --select "C408" --unsafe-fixes --output-format=concise --fix in order to limit the review scope.

Continuation of https://github.com/OSGeo/grass/pull/3947, but for the remaining code (for fixes that aren't empty collections and not in the testsuite folders), in order to separate it from other changes. Part of the effort to introduce Pylint 3.x for https://github.com/OSGeo/grass/issues/3921

Uses the fixes provided for ruff rule unnecessary-collection-call (C408) to fix part of Pylint's use-dict-literal / R1735 rule.

There is a file where there was two commented lines inside the dict. They seemed like old values. I did the change in a separate commit, and edited the comment to match the syntax in a second commit. But I rethought of it, and in a third commit, I removed it completely. The comment didn't really explain what it was, and the other values are already in the dict. This way it can be possible to rebase to drop the commits if there is a problem here.