Skip to content

style: Fix typos in Python and TeX files and enable codespell for them - #732

Open
echoix wants to merge 11 commits into
mainfrom
codespell-python-tex-typos
Open

echoix wants to merge 11 commits into
mainfrom
codespell-python-tex-typos

Conversation

@echoix

@echoix echoix commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Description

Fix the typos codespell reports in Python and TeX files, and enable codespell for those file types in pre-commit.

  • Remaining false positives (identifiers, test fixtures) are added to the ignore list or marked inline; vendored PLY and ctypesgen code is skipped.
  • No translatable (_()) strings are changed, and the public create_time_suffix(mapp, ...) signature is kept.

Motivation and context

Typos in Python and TeX files were not caught by pre-commit.

How has this been tested?

pre-commit run --all-files passes for codespell, ruff and flake8.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as before)

Checklist

  • PR title provides summary of the changes and starts with one of the pre-defined prefixes
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

The typo fixes were prepared with an AI coding assistant.

@echoix echoix changed the title CI: Enable codespell for Python and TeX files Python: Enable codespell for Python and TeX files Oct 10, 2026
@echoix echoix changed the title Python: Enable codespell for Python and TeX files docs: Fix typos in Python and TeX files and enable codespell for them Oct 10, 2026
@echoix echoix changed the title docs: Fix typos in Python and TeX files and enable codespell for them style: Fix typos in Python and TeX files and enable codespell for them Oct 10, 2026
fobj = open(fXML)
try:
tree = ET.fromstring(fo.read())
tree = ET.fromstring(fobj.read())

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This alert is pre-existing: ET.fromstring on this line is unchanged. The PR only renamed fo to fobj, so the line shows up in the diff. Not changing it here.


Generated by Claude Code

@echoix
echoix force-pushed the codespell-python-tex-typos branch from e8444fc to cdc1d3c Compare October 10, 2026 17:36
Fix typos in comments and docstrings and rename misspelled local variables,
attributes and parameters.
Fix misspelled words in comments, docstrings, error messages and test
code, and rename misspelled local variables. Abbreviated option names
and deliberate fixtures are marked for codespell instead of changed.
Remove the Python and TeX types from the codespell exclusions in
pre-commit, add the legitimate identifiers and words that codespell
flags to the ignore list, and skip the vendored PLY and ctypesgen code.

Typo fixes in the rest of this branch were prepared with an AI coding
assistant.
@echoix
echoix force-pushed the codespell-python-tex-typos branch from cdc1d3c to 06b77cd Compare October 11, 2026 12:12

echoix commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

The failing check on head 06b77cd is ubuntu (minimum config, ...). It is not caused by this PR. The job stopped while installing the ubuntugis PPA: add-apt-repository got an HTTP 504 from Launchpad, so no tests ran. The workflow was already re-running when I tried to re-run it manually, so I'm leaving that run alone. If it fails again with the same Launchpad error, I'll treat it as an infrastructure outage.


Generated by Claude Code

Comment thread gui/wxpython/vdigit/preferences.py
Comment thread lib/cdhc/doc/goodness.tex Outdated
Comment thread python/grass/temporal/datetime_math.py Outdated


def create_time_suffix(mapp, end: bool = False) -> str:
def create_time_suffix(map_name, end: bool = False) -> str:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this changing part of the public api? Is there other usages that use keyword arguments? Also take a look at grass addons.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is public: create_time_suffix is exported in grass.temporal.__all__. All callers in core and in grass-addons pass the argument positionally, but renaming the parameter would still break any mapp= keyword caller. map_name was also wrong, since the argument is a map dataset object, not a name. I reverted the rename and added mapp to the codespell ignore list (bba489d).


Generated by Claude Code

Comment thread scripts/r.grow/testsuite/test_r_grow.py Outdated
Comment thread scripts/v.report/v.report.py Outdated
claude and others added 6 commits October 11, 2026 14:11
- goodness.tex: Use "In this implementation", matching the
  surrounding text.
- grass.temporal: Keep the mapp parameter name of the public
  create_time_suffix() so keyword callers keep working, and add it to
  the codespell ignore list. The value is a map dataset object, so
  map_name was also misleading.
- r.grow test: Rename the variables of test_shrink_null consistently,
  which also removes the shrined typo.
- v.report: Name the flag has_table, since it tells whether the layer
  has an attribute table linked.
- g.md2man, g.html2man: Use a lowercase word in the codespell:ignore
  comments. Codespell only matches lowercase words there, and the
  "ignore:" form silenced the whole line.
- Fix adjacent typos left in the edited lines ("an many", "is stayed")
  and use names that pair with their counterparts (denominator,
  name_template).
…OSGeo#8054)

* CI: Install wxPython and optional dependencies in the update-i18n job

Install wxPython (python3-wxgtk4.0) and the optional dependencies of the
tools listed in the menus (cairo, fftw, freetype, geos, libsvm, netcdf,
opengl, postgres), and configure with the matching flags.

AI was used to carry out the trivial work, following the author's
implementation choices.

* CI: Pin periodic_update.yml runner to ubuntu-24.04
locale: Update translation files

Co-authored-by: echoix <27212526+echoix@users.noreply.github.com>
The sett variable read in the point and selection style layout loops
was never used, so drop it together with the merged settings dict it
was read from.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants