Skip to content

Commit cf1d4d3

Browse files
authored
CI: add typos job (#1693)
1 parent b14fbc0 commit cf1d4d3

File tree

13 files changed

+45
-18
lines changed

13 files changed

+45
-18
lines changed

.github/workflows/workspace.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ jobs:
4444
toolchain: stable
4545
components: rustfmt
4646
- run: cargo fmt --all -- --check
47+
48+
typos:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: crate-ci/typos@v1.30.0

.typos.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[files]
2+
extend-exclude = [
3+
".git/",
4+
"const-oid/oiddbgen/*.txt",
5+
"const-oid/oiddbgen/ldap-parameters-3.csv",
6+
"const-oid/src/db/generated.rs",
7+
"der/src/asn1/context_specific.rs",
8+
"pem-rfc7468/README.md",
9+
"pkcs12/tests/cert_tests.rs",
10+
"x509-ocsp/tests/responses.rs",
11+
]
12+
13+
[default.extend-identifiers]
14+
# typ stands for type, but it's a reversed identifier
15+
typ = "typ"
16+
17+
[default.extend-words]
18+
# Certificate Ann
19+
"cann" = "cann"
20+
# encrypt-decrypt-encrypt
21+
"EDE" = "EDE"

base32ct/src/encoding.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,15 @@ mod tests {
270270
use crate::{Base32, Base32Unpadded, Encoding};
271271

272272
struct LenData {
273-
fourty_bit_groups_len: usize,
273+
forty_bit_groups_len: usize,
274274
last_group_len: usize,
275275
padding_len: usize,
276276
}
277277

278278
fn get_len_data(data_len: usize) -> LenData {
279279
// More information about the calculation can be found at
280280
// https://www.rfc-editor.org/rfc/rfc4648#section-6
281-
let fourty_bit_groups_len = data_len / 5 * 8;
281+
let forty_bit_groups_len = data_len / 5 * 8;
282282
let (last_group_len, padding_len) = match data_len % 5 {
283283
0 => (0, 0),
284284
1 => (2, 6),
@@ -289,7 +289,7 @@ mod tests {
289289
};
290290

291291
LenData {
292-
fourty_bit_groups_len,
292+
forty_bit_groups_len,
293293
last_group_len,
294294
padding_len,
295295
}
@@ -303,14 +303,14 @@ mod tests {
303303
for _ in 0..10 {
304304
buf.push(b'a');
305305
let LenData {
306-
fourty_bit_groups_len,
306+
forty_bit_groups_len,
307307
last_group_len,
308308
padding_len: _,
309309
} = get_len_data(buf.len());
310310

311311
assert_eq!(
312312
Base32Unpadded::encoded_len(&buf),
313-
fourty_bit_groups_len + last_group_len
313+
forty_bit_groups_len + last_group_len
314314
);
315315
}
316316
}
@@ -323,14 +323,14 @@ mod tests {
323323
for _ in 0..10 {
324324
buf.push(b'a');
325325
let LenData {
326-
fourty_bit_groups_len,
326+
forty_bit_groups_len,
327327
last_group_len,
328328
padding_len,
329329
} = get_len_data(buf.len());
330330

331331
assert_eq!(
332332
Base32::encoded_len(&buf),
333-
fourty_bit_groups_len + last_group_len + padding_len,
333+
forty_bit_groups_len + last_group_len + padding_len,
334334
);
335335
}
336336
}

const-oid/oiddbgen/fips202.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This document lists the OIDs for
88
- SHAKE128, and
99
- SHAKE256.
1010

11-
This file was manually created, as there exists no offical document that is easily parsable.
11+
This file was manually created, as there exists no official document that is easily parsable.
1212
The SHA-3 standard is specified in [FIPS 202](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf).
1313
It references [Computer Security Objects Register (CSOR)]
1414
(https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration),

const-oid/oiddbgen/fips203.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This document lists the OIDs for
55
- ML-KEM-768, and
66
- ML-KEM-1024.
77

8-
This file was manually created, as there exists no offical document that is easily parsable.
8+
This file was manually created, as there exists no official document that is easily parsable.
99
The ML-KEM standard is specified in [FIPS 203](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf).
1010
The OIDs are defined in [Computer Security Objects Register (CSOR)]
1111
(https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration),

const-oid/oiddbgen/fips204.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This document lists the OIDs for
88
- HashML-DSA-65 with SHA512, and
99
- HashML-DSA-87 with SHA512.
1010

11-
This file was manually created, as there exists no offical document that is easily parsable.
11+
This file was manually created, as there exists no official document that is easily parsable.
1212
The ML-DSA standard is specified in [FIPS 204](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.204.pdf).
1313
The OIDs are defined in [Computer Security Objects Register (CSOR)]
1414
(https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration),

const-oid/oiddbgen/fips205.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This document lists the OIDs for
2626
- HashSLH-DSA-SHAKE-256s-with-shake256, and
2727
- HashSLH-DSA-SHAKE-256f-with-shake256.
2828

29-
This file was manually created, as there exists no offical document that is easily parsable.
29+
This file was manually created, as there exists no official document that is easily parsable.
3030
The SLH-DSA standard is specified in [FIPS 205](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.205.pdf).
3131
The OIDs are defined in [Computer Security Objects Register (CSOR)]
3232
(https://csrc.nist.gov/projects/computer-security-objects-register/algorithm-registration),

const-oid/oiddbgen/tcg-tpm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Object Identifiers (OID) for TCG TPM
33

44
This document lists the OIDs for TPM registered by the Trusted Computing Group.
55

6-
This file was manually created, as there exists no offical document that is easily parsable.
6+
This file was manually created, as there exists no official document that is easily parsable.
77

88
tcgOrganization OBJECT IDENTIFIER ::= { joint-iso-ccitt(2) international-organizations(23) 133 }
99

der/src/asn1/real.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'a> DecodeValue<'a> for f64 {
6161
n_bytes[7 - pos] = *byte;
6262
}
6363
let n = u64::from_be_bytes(n_bytes);
64-
// Multiply byt 2^F corresponds to just a left shift
64+
// Multiply byte 2^F corresponds to just a left shift
6565
let mantissa = n << scaling_factor;
6666
// Create the f64
6767
Ok(encode_f64(sign, exponent, mantissa))
@@ -838,7 +838,7 @@ mod tests {
838838
#[test]
839839
fn validation_cases() {
840840
// Caveat: these test cases are validated on the ASN.1 playground: https://asn1.io/asn1playground/ .
841-
// The test case consists in inputing the bytes in the "decode" field and checking that the decoded
841+
// The test case consists in inputting the bytes in the "decode" field and checking that the decoded
842842
// value corresponds to the one encoded here.
843843
// This tool encodes _all_ values that are non-zero in the ISO 6093 NR3 representation.
844844
// This does not seem to perfectly adhere to the ITU specifications, Special Cases section.

der_derive/src/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(crate) struct FieldAttrs {
101101
/// where encoding is omitted per DER and to omit the encoding per DER
102102
pub default: Option<Path>,
103103

104-
/// Shold we add `&` before `self.field_name`?
104+
/// Should we add `&` before `self.field_name`?
105105
pub should_deref: bool,
106106

107107
/// Is this field "extensible", i.e. preceded by the `...` extensibility marker?

0 commit comments

Comments
 (0)