Skip to content

Commit d0748fc

Browse files
authored
feat: enable crate typos on ci (#957)
* Add crate typos and typos.toml * Excluding ui/ since fork
1 parent 2a7c940 commit d0748fc

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ default_language_version:
33
node: system
44

55
repos:
6+
- repo: https://github.com/crate-ci/typos
7+
rev: 00f422f3b19c57bc6338715ebfe3316d38768461 # v1.50.3
8+
hooks:
9+
- id: typos
10+
# Drop the upstream default `--write-changes` so the hook only
11+
# reports failures instead of writing changes.
12+
# Keep `--force-exclude` so the excludes in typos.toml still
13+
# apply to the paths prek passes in.
14+
args: ["--force-exclude"]
15+
616
- repo: https://github.com/pre-commit/pre-commit-hooks
717
rev: 2c9f875913ee60ca25ce70243dc24d5b6415598c # 4.6.0
818
hooks:

‎modules/ROOT/partials/release-notes/release-26.7.adoc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ Tracked in https://github.com/stackabletech/nifi-opa-plugin/issues/30[nifi-opa-p
428428

429429
===== Open Policy Agent
430430

431+
// typos:ignore-next-line
431432
* Previously, the User Info Fetcher's outbound HTTP requests (to Microsoft Entra, Keycloak, and the XFSC AAS) had no timeout, so a slow or unresponsive backend could make a request hang indefinitely and stall user-info lookups.
432433
With this release, every outbound request has a 60-second overall timeout and a 15-second connection timeout.
433434
Implemented in https://github.com/stackabletech/opa-operator/pull/859[opa-operator#859].

‎typos.toml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Configuration for typos (https://github.com/crate-ci/typos), run via the prek
2+
# hook in .pre-commit-config.yaml.
3+
4+
[files]
5+
# Bare `typos` skips hidden dirs by default, but prek passes explicit paths and
6+
# so does check them. Turn it off so both agree.
7+
ignore-hidden = false
8+
9+
extend-exclude = [
10+
# Ignore `.git`, which the above `ignore-hidden = false` would otherwise pull in.
11+
".git/",
12+
# Vendored fork of antora-ui-default (see ui/UPSTREAM). Kept free of markers
13+
# so upstream syncs stay clean.
14+
"ui/",
15+
]
16+
17+
[default]
18+
# typos has no native suppression directive
19+
# (https://github.com/crate-ci/typos/issues/316), so these regexes provide one.
20+
# A marker must sit in a comment: after `#`, `//` or `;` (free text may follow),
21+
# or inside a closed `<!-- -->`, `/* */` or `{# #}` (free text may precede the
22+
# closer). An unterminated `typos:ignore-block-start` suppresses nothing.
23+
#
24+
# Use one of the following when the word is correct at one place but would still be a typo elsewhere:
25+
#
26+
# # typos:ignore-line at the end of the line it applies to
27+
# # typos:ignore-next-line on its own line, above the offending line
28+
# # typos:ignore-block-start / typos:ignore-block-end around a block
29+
extend-ignore-re = [
30+
'(?Rm)^.*?(?:(?:^|[^{])(?:#|//|;)[ \t]*typos:ignore-line\b.*|(?:<!--[ \t]*typos:ignore-line\b.*?-->|/\*[ \t]*typos:ignore-line\b.*?\*/|\{#[ \t]*typos:ignore-line\b.*?#\})[ \t]*)$',
31+
'(?Rm)^[ \t]*(?:(?:#|//|;)[ \t]*typos:ignore-next-line\b.*|(?:<!--[ \t]*typos:ignore-next-line\b.*?-->|/\*[ \t]*typos:ignore-next-line\b.*?\*/|\{#[ \t]*typos:ignore-next-line\b.*?#\})[ \t]*)\r?\n.*$',
32+
'(?ms)(?:(?:^|[^{])(?:#|//|;)[ \t]*typos:ignore-block-start\b|<!--[ \t]*typos:ignore-block-start\b[^\n]*?-->|/\*[ \t]*typos:ignore-block-start\b[^\n]*?\*/|\{#[ \t]*typos:ignore-block-start\b[^\n]*?#\}).*?(?:(?:^|[^{])(?:#|//|;)[ \t]*typos:ignore-block-end\b|<!--[ \t]*typos:ignore-block-end\b[^\n]*?-->|/\*[ \t]*typos:ignore-block-end\b[^\n]*?\*/|\{#[ \t]*typos:ignore-block-end\b[^\n]*?#\})',
33+
# Random draw.io etags, in `.drawio` (`etag="..."`) and `.drawio.svg`
34+
# (`etag=&quot;...&quot;`) files. Diagram labels stay checked.
35+
'etag=(?:"|&quot;)[^"&]*',
36+
# Spark's bundled ALS (Alternating Least Squares) example class, in YAML
37+
# listing blocks where a marker would render verbatim.
38+
'org\.apache\.spark\.examples\.SparkALS',
39+
]
40+
41+
# Before adding an entry in here, consider an in-place marker instead.
42+
# Every entry below gets a one-line comment saying what the word is.
43+
[default.extend-words]
44+
# Azure Kubernetes Service
45+
aks = "aks"

0 commit comments

Comments
 (0)