[GRASS-git] [OSGeo/grass] 46903c: style: Fix 12 ruff rules with small count of viola...

Edouard Choinière noreply at github.com
Wed Aug 14 14:19:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/OSGeo/grass
  Commit: 46903c0e45c802f809645b745c59265ebc619c58
      https://github.com/OSGeo/grass/commit/46903c0e45c802f809645b745c59265ebc619c58
  Author: Edouard Choinière <27212526+echoix at users.noreply.github.com>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M gui/wxpython/animation/dialogs.py
    M gui/wxpython/rdigit/toolbars.py
    M gui/wxpython/tplot/frame.py
    M gui/wxpython/web_services/dialogs.py
    M man/parser_standard_options.py
    M pyproject.toml
    M python/grass/gunittest/case.py
    M python/grass/jupyter/map3d.py
    M python/grass/pydispatch/saferef.py
    M python/grass/pygrass/utils.py
    M python/grass/pygrass/vector/testsuite/test_geometry.py
    M python/grass/script/core.py
    M python/grass/temporal/datetime_math.py
    M scripts/g.extension/g.extension.py
    M scripts/g.extension/testsuite/test_addons_download.py

  Log Message:
  -----------
  style: Fix 12 ruff rules with small count of violations (#4139)

* style: Fix import-self (PLW0406)
Ruff rule: https://docs.astral.sh/ruff/rules/import-self/
1 instance solved

* Solve Pylint W0105: pointless-string-statement for python/grass/pygrass/utils.py

* Fix bad name of ruff rule in pyproject.toml

* Fix missing space in pyproject.toml ruff rules ignore list

* style: Fix native-literals (UP018)

* style: Fix unnecessary-dict-index-lookup (PLR1733)

* style: Fix no-classmethod-decorator (PLR0202)
Ruff rule: https://docs.astral.sh/ruff/rules/no-classmethod-decorator/

1 instance fixed.

* style: Ignore remaining comparison-with-itself (PLR0124) in test_eq

Ruff rule: https://docs.astral.sh/ruff/rules/comparison-with-itself/

1 instance solved

* style: Fix ambiguous-unicode-character-docstring (RUF002)

Ruff rule: https://docs.astral.sh/ruff/rules/ambiguous-unicode-character-docstring/

2 instances solved

* style: Fix unnecessary-generator-list (C400)

Ruff rule: https://docs.astral.sh/ruff/rules/unnecessary-generator-list/

1 instance solved

* style: Fix unnecessary-generator-set (C401)

Ruff rule: https://docs.astral.sh/ruff/rules/unnecessary-generator-set/

2 instances solved

* style: Fix unnecessary-list-comprehension-set (C403)

Ruff rule: https://docs.astral.sh/ruff/rules/unnecessary-list-comprehension-set/

3 instances solved

* style: Ignore 1 instance of sys-version-info-minor-cmp-int (YTT204)

Ruff rule:
https://docs.astral.sh/ruff/rules/sys-version-info-minor-cmp-int/

Correctly checks for only Python 3. Using a tuple would not be less messy, as a second comparison for >= Python 3.0 would be needed.

* style: Fix unnecessary-literal-set (C405)

Ruff rule: https://docs.astral.sh/ruff/rules/unnecessary-literal-set/

2 instances fixed

* Fix copy paste typo in ruff rule comment

* style: Fix implicit-optional (RUF013)

Ruff rule: https://docs.astral.sh/ruff/rules/implicit-optional/

2 instances fixed

* Update scripts/g.extension/g.extension.py

---------

Co-authored-by: Stefan Blumentrath <stefan.blumentrath at gmx.de>



To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications


More information about the grass-commit mailing list