Conversation
Techassi
left a comment
There was a problem hiding this comment.
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.
| # 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. |
There was a problem hiding this comment.
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.
| # 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. |
There was a problem hiding this comment.
| # 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. |
| - 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"] |
There was a problem hiding this comment.
The same comments from above apply here as well.
|
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? |
…ackabletech/operator-templating into feat/enable-crate-typos-on-ci
|
|
||
| ### The core config | ||
|
|
||
| As convention, new repositories should start from this block and add only what they actually need. |
There was a problem hiding this comment.
| 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. |
| # 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 |
There was a problem hiding this comment.
I feel like this should be ignore-line instead to be in line with the ignore-next-line one.
| # # spellchecker:disable-line at the end of the line it applies to | |
| # # spellchecker:ignore-line at the end of the line it applies to |
| # * 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*$", |
There was a problem hiding this comment.
| "(?Rm)^.*(#|//|<!--|;|/\\*)\\s*spellchecker:disable-line\\s*(-->|#\\}|\\*/)?\\s*$", | |
| "(?Rm)^.*(#|//|<!--|;|/\\*)\\s*spellchecker:ignore-line\\s*(-->|#\\}|\\*/)?\\s*$", |
| # # 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 "/".
| [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, |
There was a problem hiding this comment.
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
| `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 --> |
There was a problem hiding this comment.
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.
| `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. |
There was a problem hiding this comment.
Repetition. This is already explained above. No need to explain it again.
|
|
||
| `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. |
There was a problem hiding this comment.
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.
|
|
||
| ### Conventions | ||
|
|
||
| - The hook runs report-only. `args: ["--force-exclude"]`. |
There was a problem hiding this comment.
Repetition, already explained above. Also, the missing --write-changes causes this to be run in report-only mode.
| ### 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. |
There was a problem hiding this comment.
Already mentioned above, but fine to mention it again outside of the config file.
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