Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ repos:
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/codespell-project/codespell
rev: "v2.4.1"
- repo: https://github.com/crate-ci/typos
rev: "v1.40.0"
hooks:
- id: codespell
- id: typos
exclude: ^Gemfile\.lock$
additional_dependencies:
- tomli; python_version<'3.11'
args: ["-w"]

- repo: local
hooks:
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/guides/gha_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ actions have outputs, and bash actions can manually write to output:
You can now refer to this step in a later step with
`${{ steps.someid.something }}`. You also can get it from another job by using
`${{ needs.<jobname>.outputs.something }}`. The `toJson()` function is useful
for inputing JSON - you can even generate matrices dynamically this way!
for inputting JSON - you can even generate matrices dynamically this way!

{% endraw %}

Expand Down
43 changes: 40 additions & 3 deletions docs/pages/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,13 @@ Make sure you list the highest version of Python you are testing with here.
## Spelling

{% rr PC160 %} You can and should check for spelling errors in your code too. If
you want to add this, you can use [codespell][] for common spelling mistakes.
Unlike most spell checkers, this has a list of mistakes it looks for, rather
than a list of "valid" words. To use:
you want to add this, you can use a code-ready spell checker for common spelling
mistakes. Unlike most spell checkers, these have a list of mistakes they look
for, rather than a list of "valid" words. To use:

{% tabs spell %} {% tab codespell codespell %}

If you want a Python based tool, [codespell] is the classic tool used.

```yaml
- repo: https://github.com/codespell-project/codespell
Expand All @@ -772,6 +776,37 @@ You can also add the `-w` flag to have it automatically correct errors - this is
very helpful to quickly make corrections if you have a lot of them when first
adding the check. `uvx codespell -w` will quickly correct all non-hidden files.

{% endtab %} {% tab typos typos %}

A rust rewrite of [codespell][], [typos][] has a defining feature: It can find
typos in CamelCase or snake_case variable names. It also is probably faster,
though codespell is very fast too. This one is not available on PyPI, use
pre-commit, gh-install, brew, cargo, or conda/pixi. It also has LSP (VSCode)
integration.

```yaml
- repo: https://github.com/crate-ci/typos
rev: "v1.40.0"
hooks:
- id: typos
args: []
```

To configure it, you can use this section in `pyproject.toml`:

```toml
[tool.typos.default.extend-words]
nd = "nd"
sur = "sur"
```

It has quite a few supported configuration options, like adding your own
corrections, feel free to check the [full reference][typos-ref]. If you want it
to write changes, you can remove the `args: []` in the pre-commit hook, or add
`-w` when running it locally.

{% endtab %} {% endtabs %}

You can also use a local pygrep check to eliminate common capitalization errors,
such as the one below:

Expand Down Expand Up @@ -992,6 +1027,8 @@ You also might like the following hook, which cleans Jupyter outputs:
[check-jsonschema]: https://check-jsonschema.readthedocs.io/en/latest/
[cjs-common]: https://check-jsonschema.readthedocs.io/en/latest/precommit_usage.html#supported-hooks
[schemastore]: https://schemastore.org
[typos]: https://github.com/crate-ci/typos
[typos-ref]: https://github.com/crate-ci/typos/blob/master/docs/reference.md

<!-- prettier-ignore-end -->

Expand Down
6 changes: 3 additions & 3 deletions docs/pages/principles/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ import pytest


@pytest.mark.slow
def test_somthing_slow(): ...
def test_something_slow(): ...
```

To mark every test in a directory, add the following to the `conftest.py` in the
Expand Down Expand Up @@ -626,8 +626,8 @@ much more complex and difficult to read for new developers.
## Diagnostic Tests

Diagnostic tests are used to verify the installation of a package. They should
be runable on production systems, like when we need to ssh into a live server to
troubleshoot problems.
be runnable on production systems, like when we need to ssh into a live server
to troubleshoot problems.

A diagnostic test suite may contain any combination of tests you deem pertinent.
You could include all the unit tests, or a specific subset of them. You may want
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ ignore = [
[tool.repo-review.ignore]
RTD103 = "Using Ruby instead of Python for docs"

[tool.codespell]
ignore-words-list = [
"nd",
]
[tool.typos.default.extend-words]
nd = "nd"
sur = "sur"