GeezerVison is showing github.com — Add typos for source code spelling check (#4690) · GenericMappingTools/pygmt@4172333
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/4-release_checklist.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -33,7 +33,7 @@ assignees: '' | 33 | 33 | - [ ] Update warnings in `pygmt/_show_versions.py` as well as notes in [Not working transparency](https://www.pygmt.org/dev/install.html#not-working-transparency) regarding GMT-Ghostscript incompatibility | 34 | 34 | - [ ] Reserve a DOI on [Zenodo](https://zenodo.org) by clicking on "New Version" | 35 | 35 | - [ ] Finish up the "Changelog entry for v0.x.x" Pull Request (Use the previous changelog PR as a reference) | 36 | | -- [ ] Run `make codespell` to check common misspellings. If there are any, either fix them or add them to `ignore-words-list` in `pyproject.toml` | | 36 | +- [ ] Run `make spellcheck` to check common misspellings. If there are any, either fix them or add them to the relevant spelling configuration in `pyproject.toml` | 37 | 37 | - [ ] Draft the announcement on https://hackmd.io/@pygmt | 38 | 38 |
| 39 | 39 | **Release**: | |
Collapse file Copy file name to clipboardExpand all lines: Makefile +6-3Lines changed: 6 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 16 | 16 | @echo " test_no_images run the test suite (including all doctests) but skip image comparisons" | 17 | 17 | @echo " format run Ruff to automatically format the code" | 18 | 18 | @echo " check run Ruff to check code style and quality" | 19 | | - @echo " codespell run codespell to check common misspellings" | | 19 | + @echo " spellcheck run codespell and typos to check common misspellings" | 20 | 20 | @echo " typecheck run mypy for static type check" | 21 | 21 | @echo " clean clean up build and generated files" | 22 | 22 | @echo " distclean clean up build and generated files, including project metadata files" | @@ -67,8 +67,11 @@ check: | 67 | 67 | ruff check $(FORMAT_FILES) | 68 | 68 | ruff format --check $(FORMAT_FILES) | 69 | 69 |
| 70 | | -codespell: | 71 | | - @codespell | | 70 | +spellcheck: | | 71 | + @status=0; \ | | 72 | + codespell || status=1; \ | | 73 | + typos || status=1; \ | | 74 | + exit $$status | 72 | 75 |
| 73 | 76 | typecheck: | 74 | 77 | mypy ${PROJECT} | |
Collapse file Copy file name to clipboardExpand all lines: doc/techref/justification_codes.md +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,8 +10,8 @@ figure (**reference point**) and a point on the feature (**anchor point**). For | 10 | 10 | users can use a two-character code, a combination of a vertical code and a horizontal | 11 | 11 | code (order-independent): | 12 | 12 |
| 13 | | -- Vertical: **T**(op), **M**(iddle), **B**(ottom) | 14 | | -- Horizontal: **L**(eft), **C**(entre), **R**(ight) | | 13 | +- Vertical: **T** (Top), **M** (Middle), **B** (Bottom) | | 14 | +- Horizontal: **L** (Left), **C** (Centre), **R** (Right) | 15 | 15 |
| 16 | 16 | For example, `"TL"` means **T**op **L**eft. | 17 | 17 |
| |
Collapse file Copy file name to clipboardExpand all lines: environment.yml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,7 @@ dependencies: | 27 | 27 | - codespell | 28 | 28 | - prek | 29 | 29 | - ruff>=0.15.5 | | 30 | + - typos | 30 | 31 | # Dev dependencies (unit testing) | 31 | 32 | - matplotlib-base | 32 | 33 | - pytest>=6.0 | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/src/velo.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -239,7 +239,7 @@ def velo( # noqa : PLR0913 | 239 | 239 | Select the quantity that will be used with the CPT given via ``cmap`` | 240 | 240 | to set the fill color. Choose from **m**\ agnitude (vector magnitude | 241 | 241 | or rotation magnitude), **e**\ ast-west velocity, **n**\ orth-south | 242 | | - velocity, or **u**\ ser-supplied data column (supplied after the | | 242 | + velocity, or **u** (user-supplied data column after the | 243 | 243 | required columns). To instead use the corresponding error estimates | 244 | 244 | (i.e., vector or rotation uncertainty) to lookup the color and paint | 245 | 245 | the error ellipse or wedge instead, append **+e**. | |
Collapse file Copy file name to clipboardExpand all lines: pygmt/tests/test_session_management.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -21,7 +21,7 @@ def test_begin_end(): | 21 | 21 | end() # Kill the global session | 22 | 22 | begin() | 23 | 23 | with Session() as lib: | 24 | | - lib.call_module("basemap", ["-R10/70/-3/8", "-JX4i/3i", "-Ba"]) | | 24 | + lib.call_module("basemap", ["-R10/70/-3/8", "-JX4i/3i", "-Bafg"]) | 25 | 25 | end() | 26 | 26 | begin() # Restart the global session | 27 | 27 | assert Path("pygmt-session.pdf").exists() | @@ -42,7 +42,7 @@ def test_gmt_compat_6_is_applied(capsys): | 42 | 42 | lib.call_module("gmtset", ["GMT_COMPATIBILITY=5"]) | 43 | 43 | begin() | 44 | 44 | with Session() as lib: | 45 | | - lib.call_module("basemap", ["-R10/70/-3/8", "-JX4i/3i", "-Ba"]) | | 45 | + lib.call_module("basemap", ["-R10/70/-3/8", "-JX4i/3i", "-Bafg"]) | 46 | 46 | out, err = capsys.readouterr() # capture stdout and stderr | 47 | 47 | assert out == "" | 48 | 48 | assert err != ( | |
Collapse file Copy file name to clipboardExpand all lines: pyproject.toml +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -73,6 +73,22 @@ fallback_version = "999.999.999+unknown" | 73 | 73 | [tool.codespell] | 74 | 74 | ignore-words-list = "astroid,te,tripel,trough" | 75 | 75 |
| | 76 | +[tool.typos.default] | | 77 | +extend-ignore-re = [ | | 78 | + # Ignore lines that end with `# codespell:ignore` | | 79 | + # TODO: Refactor the re if codespell support is dropped in the future. | | 80 | + "(?Rm)^.*(#|//)\\s*codespell:ignore$", | | 81 | +] | | 82 | +extend-ignore-words-re = [ | | 83 | + "astroid", | | 84 | + "fo", # codespell:ignore | | 85 | + "OCE", # codespell:ignore | | 86 | + "[tT]ripel", | | 87 | +] | | 88 | +extend-ignore-identifiers-re = [ | | 89 | + "pn", | | 90 | +] | | 91 | + | 76 | 92 | [tool.coverage.run] | 77 | 93 | omit = ["*/tests/*", "*pygmt/__init__.py"] | 78 | 94 |
| |
|