Skip to content

feat: Enable spellchecking via crate-ci/typos - #649

Open
Maleware wants to merge 12 commits into
mainfrom
feat/enable-crate-typos-on-ci
Open

Maleware wants to merge 12 commits into
mainfrom
feat/enable-crate-typos-on-ci

Conversation

@Maleware

@Maleware Maleware commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

This is part 1 of https://github.com/stackabletech/retro/issues/36

-> Currently a suggestion on how to approach this

Trino-Operator spike: stackabletech/trino-operator#942
docker-images spike: stackabletech/docker-images#1634

@Techassi Techassi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems fully LLM generated and it shows.

There are just plain wrong statements, a whole bunch of unnecessary fluff, statements about well-known facts, and duplication.

In my opinion, this needs a bunch of work. I could point out all things I didn't like, but that's something I don't want to invest time for. I'm not here to review LLM-generated stuff.

I still left a few comments.

Comment thread README.md Outdated
Comment on lines +84 to +85
# check them. Turn it off so a local run and the hook agree; without it, .github/
# and .readme/ are invisible locally but not to CI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is just wrong. The config is always used, independent of how typos is called (either manually (I assume that is what "local run" refers to) or via prek/pre-commit).

The same prek config is used locally and in CI. So there is literally no difference here.

It is however good to change the default of ignore-hidden.

Comment thread template/.pre-commit-config.yaml.j2 Outdated
Comment thread template/.pre-commit-config.yaml.j2 Outdated
Comment on lines +19 to +21
# Drop the upstream default `--write-changes` so the hook reports and
# fails instead of rewriting files. Keep `--force-exclude` so the
# excludes in typos.toml still apply to the paths prek passes in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
# Drop the upstream default `--write-changes` so the hook reports and
# fails instead of rewriting files. Keep `--force-exclude` so the
# excludes in typos.toml still apply to the paths prek passes in.
# Drop the upstream default `--write-changes` so the hook only
# reports failures instead of writing changes.
# Keep `--force-exclude` so the excludes in typos.toml still
# apply to the paths prek passes in.

Comment thread template/.pre-commit-config.yaml.j2 Outdated
Comment thread .pre-commit-config.yaml
Comment on lines +8 to +15
- repo: https://github.com/crate-ci/typos
rev: v1.50.1
hooks:
- id: typos
# Drop the upstream default `--write-changes` so the hook reports and
# fails instead of rewriting files. Keep `--force-exclude` so the
# excludes in typos.toml still apply to the paths prek passes in.
args: ["--force-exclude"]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The same comments from above apply here as well.

@Maleware

Maleware commented Sep 28, 2026 •

Copy link
Copy Markdown
Member Author

Yeah, as I said in the Issue is only here to give the idea of what I want to do. It was never meant to be completed as is.

Thank you for your review however. Would you be happy on how configs are split across repositories?

Comment thread README.md Outdated

### The core config

As convention, new repositories should start from this block and add only what they actually need.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
As convention, new repositories should start from this block and add only what they actually need.
As a convention, new repositories should start from this block and add only what they actually need.

Comment thread README.md Outdated
# Before adding an entry here, consider an in-place marker instead. Use one when
# the word is correct at this one site and would still be a typo elsewhere:
#
# # spellchecker:disable-line at the end of the line it applies to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I feel like this should be ignore-line instead to be in line with the ignore-next-line one.

Suggested change
# # spellchecker:disable-line at the end of the line it applies to
# # spellchecker:ignore-line at the end of the line it applies to

Comment thread README.md Outdated
# * unterminated `:off` suppresses nothing rather than swallowing the rest of the file.
# * `disable-line` only matches when the marker ends the line.
extend-ignore-re = [
"(?Rm)^.*(#|//|<!--|;|/\\*)\\s*spellchecker:disable-line\\s*(-->|#\\}|\\*/)?\\s*$",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"(?Rm)^.*(#|//|<!--|;|/\\*)\\s*spellchecker:disable-line\\s*(-->|#\\}|\\*/)?\\s*$",
"(?Rm)^.*(#|//|<!--|;|/\\*)\\s*spellchecker:ignore-line\\s*(-->|#\\}|\\*/)?\\s*$",

Comment thread README.md Outdated
Comment on lines +88 to +90
# # spellchecker:disable-line at the end of the line it applies to
# # spellchecker:ignore-next-line on its own line, above the offending line
# # spellchecker:off / :on around a block

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On a more general note: I feel like "spellchecker" is too generic to use as a comment. My two competing thoughts on this:

  • It is too generic and might trigger something for some other tool
  • It is generic and as such, we wouldn't need to change them if we ever decide to switch tools

Overall, I would be in favour of making them more concrete, like crate-ci/typos for example.

@Maleware Maleware Oct 2, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see your point. The intent was that if we change at some point the underlying tool, we do not have to change the naming across many repositories. I didn't find overlaps so I chose a generic approach.

Since we would need to touch that anyways, would you be fine to use typos instead? I'd like to save "-" and "/".

Comment thread README.md Outdated
[default]
# typos has no native suppression directive
# (https://github.com/crate-ci/typos/issues/316), so these regexes provide one.
# They cover `#`, `//`, `<!-- -->`, `;`, `/* */` and Jinja `{# #}` comments,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are a couple of issues regarding this statement and the regexes below:

  • Using #, // or ; unterminated is fine. But if a user does decide to put anything other than whitespace behind the comment the regex no longer matches.
  • Some comment indicators must terminate as they would otherwise cause syntax errors. Those include <!-- -->, /* */, and {# #}. The regex currently doesn't enforce this.
  • {# #} is straight up missing from the regexes

Comment thread README.md Outdated
Comment on lines +132 to +134
`aks` is the only word that is universal.
Everything else measured across the operator repositories turned out to be repo-local: `aas` in opa-operator, `shs` in spark-k8s-operator, base64 fixtures in secret-operator. <!-- spellchecker:disable-line -->
Short tokens that appear in several repositories (`ot`, `fo`) do so for unrelated reasons and belong in the repository that has them, not here. <!-- spellchecker:disable-line -->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Again, do we need this extra fluff? This might have been true now, but who knows what other "universal" words there might be. The text above cleary states that this snippet is a good starting point as a per-repo config.

Comment thread README.md Outdated
Comment on lines +138 to +139
`extra/crds.yaml` is excluded on purpose.
Its content is generated partly Kubernetes' own schema documentation and partly doc comments owned by `operator-rs` or by the operator's own `crd` module, the latter is already checked independently.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Repetition. This is already explained above. No need to explain it again.

Comment thread README.md Outdated

`extra/crds.yaml` is excluded on purpose.
Its content is generated partly Kubernetes' own schema documentation and partly doc comments owned by `operator-rs` or by the operator's own `crd` module, the latter is already checked independently.
The same applies to files rendered from `template/`: a typo in `template/.readme/partials/borrowed/footer.md.j2.j2` is caught here, once, instead of in all sixteen repositories.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This generally makes sense to be mentioned, but not here and with reduced fluff. I suggest moving it to the top of the spell checking section and removing the example.

Comment thread README.md Outdated

### Conventions

- The hook runs report-only. `args: ["--force-exclude"]`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Repetition, already explained above. Also, the missing --write-changes causes this to be run in report-only mode.

Comment thread README.md
### Conventions

- The hook runs report-only. `args: ["--force-exclude"]`.
- Every entry in a `typos.toml` gets a one-line comment saying what the word is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Already mentioned above, but fine to mention it again outside of the config file.

@Techassi Techassi changed the title enable typos in operator-templating and downstream feat: Enable spellchecking via crate-ci/typos Oct 2, 2026
@Maleware Maleware self-assigned this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

2 participants