checks: Flake8 F841 fixes in the scripts directory part 2 #4241
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Flake8 F841 (local variable assigned to but never used) fixes in the
scripts
directory.Motivation and context
Changes require resolving a part of Flake8 warnings that are currently ignored. The issue title and number as follows.
How has this been tested?
v.semantic.label
Removed unused
as e
fromexcept
. I don’t see this type of fix cause any issues. However, I tested with testsuit and all passed.v.import
Removed unused
tgtsrs
value assignment and leftgs.read_command("g.proj", flags="j", quiet=True)
.With the GUI, I tried importing the data/all_types.gpkg and data/all_types_wgs84.gpkg files and encountered no errors.
Testsuit
test_import_gpkg_wgs84
failed forself.assertVectorFitsRegionInfo
. I don't see how this is related to F841 fixes, more likely GDAL version differences or something else. I personally find it no big deal since it's just a slight difference in reference and GUI worked just fine.v.report
Removed unused line
numcols = len(colnames) + len(extracolnames)
. Tested with GUI since no testsuit. Worked fine.v.unpack
Removed a variable assignment kept grass.read_command(…). Tested with testsuit and all passed.
Types of changes
Remove unused variables and/or entire lines when applicable.
functionality to not work as before)
Checklist
It would be greatly appreciated if someone could point me to documentation on when to use "checks" prefix in PRs.
pre-defined prefixes
of this project.