Skip to content

Commit 460114c

Browse files
feat: Rollout crate/typos for operators (#760)
* chore: Generated commit to update templated files since the last template run up to stackabletech/operator-templating@0f53eec Reference-to: stackabletech/operator-templating@0f53eec (feat: Rollout crate/typos for operators) * chore: Add typos.toml and fix spelling findings --------- Co-authored-by: Maxi Wittich <maximilian.wittich@stackable.tech>
1 parent cd5def1 commit 460114c

10 files changed

Lines changed: 77 additions & 8 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ default_language_version:
77
node: system
88

99
repos:
10+
# The word lists live in a per-repo `typos.toml`, which is not templated.
11+
# typos has no layered configuration (https://github.com/crate-ci/typos/issues/193).
12+
# A templated config can currently not be extended locally.
13+
- repo: https://github.com/crate-ci/typos
14+
rev: 00f422f3b19c57bc6338715ebfe3316d38768461 # v1.50.3
15+
hooks:
16+
- id: typos
17+
# Drop the upstream default `--write-changes` so the hook only
18+
# reports failures instead of writing changes.
19+
# Keep `--force-exclude` so the excludes in typos.toml still
20+
# apply to the paths prek passes in.
21+
args: ["--force-exclude"]
22+
1023
- repo: https://github.com/pre-commit/pre-commit-hooks
1124
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # 6.0.0
1225
hooks:

‎docs/modules/secret-operator/pages/openshift.adoc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ Upgrading to a new version requires you to uninstall the existing version of the
2121
* SecretClass: tls
2222
* ServiceAccount: secret-operator-service-account
2323
* ClusterRole: secret-operator-clusterrole
24-
* ClusterRoleBinding: secret-opreator-clusterrole-binding
24+
* ClusterRoleBinding: secret-operator-clusterrole-binding
2525

26-
After these resources have been cleand up, you can install a new version of the operator.
26+
After these resources have been cleaned up, you can install a new version of the operator.

‎rust/cert-tools/src/cert_ext.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub enum Error {
1313
#[snafu(display("failed to convert certificate serial number to a hexadecimal string"))]
1414
ConvertSerialToHexString { source: openssl::error::ErrorStack },
1515

16-
#[snafu(display("failed to retireve certificate digest as SHA256"))]
16+
#[snafu(display("failed to retrieve certificate digest as SHA256"))]
1717
RetrieveDigest { source: openssl::error::ErrorStack },
1818
}
1919

‎rust/cert-tools/src/cmds/pkcs12.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub enum Error {
1313
))]
1414
NoCertificateSources,
1515

16-
#[snafu(display("failed to read certifcate source at {path}", path = path.display()))]
16+
#[snafu(display("failed to read certificate source at {path}", path = path.display()))]
1717
ReadCertificate {
1818
source: crate::cli::CertInputError,
1919
path: PathBuf,

‎rust/cert-tools/src/parsers/pkcs12.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use snafu::{OptionExt, ResultExt, Snafu};
88

99
#[derive(Debug, Snafu)]
1010
pub enum ParseError {
11-
#[snafu(display("failed to deseralize PKCS#12 DER encoded file"))]
11+
#[snafu(display("failed to deserialize PKCS#12 DER encoded file"))]
1212
DeserializeFile { source: openssl::error::ErrorStack },
1313

1414
#[snafu(display("failed to parse file as PKCS#12"))]

‎rust/operator-binary/src/backend/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub struct TrustSelector {
180180
#[strum(serialize_all = "kebab-case")]
181181
#[serde(rename_all = "kebab-case")]
182182
pub enum ProvisionParts {
183-
/// Provision only public (non-senstive) data.
183+
/// Provision only public (non-sensitive) data.
184184
Public,
185185

186186
/// Provision both public and private data.

‎rust/operator-binary/src/format/well_known.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl WellKnownSecretData {
106106

107107
// Which file is tried to be parsed first matters. To support the use-case of people bringing
108108
// their own non-sensitive data via a Secret and consumers only requiring access to
109-
// non-sensitve data (for example for CA verification), the non-senstive files are parsed
109+
// non-sensitive data (for example for CA verification), the non-sensitive files are parsed
110110
// first. If the `relaxed` flag is provided, this function tries to parse sensitive files
111111
// but won't hard-error when they are not found.
112112

‎scripts/generate-olm.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
}
4747

4848
# Stackable logo icon (PNG, base64-encoded). Sourced from the 25.11.0 OLM bundle.
49+
# typos:ignore-block-start
4950
_STACKABLE_ICON_B64 = (
5051
"iVBORw0KGgoAAAANSUhEUgAABCQAAAQ3CAYAAAAg1L88AAAACXBIWXMAABcRAAAXEQHKJvM/AAAg"
5152
"AElEQVR4nOzdT2ycZ4Ln95c09YdqW5SsluWxvSDdA3m7G2iIyCEBFsFaM0DqKt820WW8OSUGAhh7"
@@ -943,6 +944,7 @@
943944
"EgAAAEB0ggQAAAAQnSABAAAARCdIAAAAANEJEgAAAEB0ggQAAAAQnSABAAAARCdIAAAAANEJEgAA"
944945
"AEB0ggQAAAAQnSABAAAARCdIAAAAANEJEgAAAEBcSZL8f1HQsc8tcXUVAAAAAElFTkSuQmCC"
945946
)
947+
# typos:ignore-block-end
946948

947949
# Permissions required by the olm-deployer service account (the bootstrap Deployment).
948950
# This account applies the ConfigMap manifests (DaemonSet, Deployment, CSIDriver, etc.).

‎scripts/release_cert-tools.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fi
6060
git add rust/cert-tools/CHANGELOG.md rust/cert-tools/Cargo.*
6161
git commit --message "chore(cert-tools): Release $CLEANED_BUMPED_VERSION" --no-verify --gpg-sign
6262

63-
echo "Do you want to proceed with rasing a PR (y/N)?"
63+
echo "Do you want to proceed with raising a PR (y/N)?"
6464
read -r RESPONSE
6565

6666
if [[ "$RESPONSE" == "y" || "$RESPONSE" == "Y" ]]; then

‎typos.toml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
# Generated by crate2nix (`make regenerate-nix`). Already skipped by the prek
13+
# top-level `exclude`; listed here so a bare `typos` run agrees.
14+
"Cargo.nix",
15+
# Generated by `make regenerate-charts` from the Rust doc comments, which are
16+
# checked at their source. The rest is Kubernetes' own schema documentation.
17+
"extra/crds.yaml",
18+
]
19+
20+
[default]
21+
# typos has no native suppression directive
22+
# (https://github.com/crate-ci/typos/issues/316), so these regexes provide one.
23+
# A marker must sit in a comment: after `#`, `//` or `;` (free text may follow),
24+
# or inside a closed `<!-- -->`, `/* */` or `{# #}` (free text may precede the
25+
# closer). An unterminated `typos:ignore-block-start` suppresses nothing.
26+
#
27+
# Use one of the following when the word is correct at one place but would still be a typo elsewhere:
28+
#
29+
# # typos:ignore-line at the end of the line it applies to
30+
# # typos:ignore-next-line on its own line, above the offending line
31+
# # typos:ignore-block-start / typos:ignore-block-end around a block
32+
extend-ignore-re = [
33+
'(?Rm)^.*?(?:(?:^|[^{])(?:#|//|;)[ \t]*typos:ignore-line\b.*|(?:<!--[ \t]*typos:ignore-line\b.*?-->|/\*[ \t]*typos:ignore-line\b.*?\*/|\{#[ \t]*typos:ignore-line\b.*?#\})[ \t]*)$',
34+
'(?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.*$',
35+
'(?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]*?#\})',
36+
# Base64 bodies of PEM blocks (test certificates and CAs).
37+
'(?s)-----BEGIN [A-Z ]+-----.*?-----END [A-Z ]+-----',
38+
]
39+
40+
# Before adding an entry in here, consider an in-place marker instead.
41+
# Every entry below gets a one-line comment saying what the word is.
42+
[default.extend-words]
43+
# Azure Kubernetes Service
44+
aks = "aks"
45+
# Accepted variant of "unparsable". Used in a cert-manager backend test name.
46+
unparseable = "unparseable"
47+
# openssl's `-passin` flag.
48+
passin = "passin"
49+
50+
[default.extend-identifiers]
51+
# Short for "type", which is a Rust keyword. Used as a field and binding name.
52+
tpe = "tpe"
53+
# Triple-DES EDE (encrypt-decrypt-encrypt) cipher type from the `des` crate.
54+
TdesEde3 = "TdesEde3"

0 commit comments

Comments
 (0)