Skip to content

Commit 8416074

Browse files
brimonkboquan-fangjmayclindougch
authored
ci: add typo check to ci (#5491)
Co-authored-by: Boquan Fang <boquanfang3@gmail.com> Co-authored-by: James Mayclin <maycj@amazon.com> Co-authored-by: Doug Chapman <54039637+dougch@users.noreply.github.com>
1 parent 7281a99 commit 8416074

File tree

19 files changed

+65
-33
lines changed

19 files changed

+65
-33
lines changed
Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
[default]
22
binary = false
33
check-filename = true
4+
extend-ignore-identifiers-re = [
5+
"PNGs",
6+
"_EDE_",
7+
"ETyp",
8+
]
49

510
[default.extend-words]
6-
alloced = "alloced"
7-
s2nd = "s2nd"
11+
# prevent the "nd" in "s2nd" from being corrected to "and"
812
nd = "nd"
13+
# prevent re:Inforce, the AWS cloud security event from being corrected (READING-LIST.md)
914
Inforce = "Inforce"
1015

1116
# While we build up the extend-words list
@@ -21,30 +26,33 @@ check-file = false
2126
[type.make]
2227
check-file = false
2328

24-
[type.cmake]
25-
check-file = false
29+
[type.cmake.extend-words]
30+
# 'thr' is the FreeBSD threading library
31+
thr = "thr"
32+
testss = "testss"
2633

2734
[type.rust]
2835
check-file = false
2936

30-
[type.sh]
31-
check-file = false
32-
3337
[files]
3438
extend-exclude = [
35-
"*.bin",
3639
"**/corpus/*",
40+
"**/mime.types",
41+
"**/specs/**/*",
42+
"*.bin",
43+
"*.conf",
3744
"*.cry",
3845
"*.der",
3946
"*.h",
4047
"*.kat",
41-
"*.pem",
4248
"*.patch",
49+
"*.pcap",
4350
"*.pdf",
51+
"*.pem",
4452
"*.png",
53+
"*.priv",
4554
"*.saw",
4655
"*.snap",
4756
"*.suppressions",
48-
"**/specs/**/*",
49-
57+
"tests/integrationv2/README.md",
5058
]

.github/workflows/docs.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@ permissions:
1414
pages: write
1515

1616
jobs:
17+
typos:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
submodules: true
23+
24+
- name: Install rust toolchain
25+
id: toolchain
26+
run: |
27+
rustup toolchain install stable --profile minimal
28+
rustup override set stable
29+
30+
- uses: camshaft/install@v1
31+
with:
32+
crate: typos-cli
33+
bins: typos
34+
35+
- name: Run typos
36+
run: |
37+
typos -c .github/config/typos.toml --format json | tee /tmp/typos.json | jq -rs '.[] | "::error file=\(.path),line=\(.line_num),col=\(.byte_offset)::\(.typo) should be \"" + (.corrections // [] | join("\" or \"") + "\"")'
38+
cat /tmp/typos.json
39+
! grep -q '[^[:space:]]' /tmp/typos.json
40+
1741
generate-doxygen:
1842
runs-on: ubuntu-latest
1943
steps:

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ endif()
375375

376376
if (S2N_INTERN_LIBCRYPTO)
377377

378-
# Check if the AWS::crypto target has beeen added and handle it
378+
# Check if the AWS::crypto target has been added and handle it
379379
if (TARGET AWS::crypto)
380380
# Get the target library type (shared or static)
381381
get_target_property(target_type AWS::crypto TYPE)
@@ -410,7 +410,7 @@ if (S2N_INTERN_LIBCRYPTO)
410410
cp ${crypto_STATIC_LIBRARY} s2n_libcrypto.a &&
411411
# dump all of the symbols and prefix them with `s2n$`
412412
bash -c "${CMAKE_NM} s2n_libcrypto.a | awk '/ [A-Z] /{if ($3) print $3\" s2n$\"$3}' | sort | uniq > libcrypto.symbols" &&
413-
# redefine the libcrypto libary symbols
413+
# redefine the libcrypto library symbols
414414
${CMAKE_OBJCOPY} --redefine-syms libcrypto.symbols s2n_libcrypto.a &&
415415
rm -rf s2n_libcrypto &&
416416
mkdir s2n_libcrypto &&

codebuild/bin/install_default_dependencies.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ if [[ "$TESTS" == "integrationv2" || "$TESTS" == "ALL" ]]; then
9292
brew install python@3
9393
python3 -m pip install --user tox ;;
9494
*)
95-
echo "Unkown platform $DISTRO trying to install tox on $OS_NAME $ARCH"
95+
echo "Unknown platform $DISTRO trying to install tox on $OS_NAME $ARCH"
9696
exit 1
9797
;;
9898
esac
@@ -113,7 +113,7 @@ if [[ "$TESTS" == "integrationv2" || "$TESTS" == "ALL" ]]; then
113113

114114
if [[ "$DISTRO" == "ubuntu" ]]; then
115115
# Install SSLyze for all Integration Tests on Ubuntu.
116-
# There is a nassl dependancy issue preventing this from working on on AL2 ARM (others?).
116+
# There is a nassl dependency issue preventing this from working on on AL2 ARM (others?).
117117
if [[ "$S2N_NO_SSLYZE" != "true" ]]; then
118118
codebuild/bin/install_sslyze.sh
119119
fi

codebuild/bin/install_ubuntu_dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# permissions and limitations under the License.
1414
#
1515

16-
# Shim code to get local docker/ec2 instances bootstraped like a CodeBuild instance.
16+
# Shim code to get local docker/ec2 instances bootstrapped like a CodeBuild instance.
1717
# Not actually used by CodeBuild.
1818

1919
source codebuild/bin/s2n_setup_env.sh

codebuild/bin/s2n_fips_openssl.cnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ stateOrProvinceName_default = Some-State
168168
localityName = Locality Name (eg, city)
169169

170170
0.organizationName = Organization Name (eg, company)
171-
0.organizationName_default = Internet Widgits Pty Ltd
171+
0.organizationName_default = Internet Widgets Pty Ltd
172172

173173
# we can do this but it is not needed normally :-)
174174
#1.organizationName = Second Organization Name (eg, company)

codebuild/bin/s2n_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if [[ -f "/etc/os-release" ]]; then
7373
elif [[ -x "/usr/bin/sw_vers" ]]; then
7474
export DISTRO="apple"
7575
export VERSION_ID=$(sw_vers -productVersion|sed 's/:[[:space:]]*/=/g')
76-
export VERSION_CODENAME="unknown" # not queriable via CLI
76+
export VERSION_CODENAME="unknown" # not queryable via CLI
7777
else
7878
export DISTRO="unknown"
7979
export VERSION_ID="unknown"

codebuild/bin/utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ criterion_install_deps(){
3838

3939
usage(){
4040
echo -e "Usage:\n\tget_latest_release: returns just the latest v.N.N.N version"
41-
echo -e "\tgh_login <Secret Name> : retrieves a GitHub PAT from secrest manager and logs into GitHub.\n"
41+
echo -e "\tgh_login <Secret Name> : retrieves a GitHub PAT from secrets manager and logs into GitHub.\n"
4242
}
4343

4444
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then

docs/development/APPLICATION_DATA.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ s2n-tls attempts to send any necessary post-handshake messages BEFORE sending an
118118

119119
If the send buffer is configured to be larger than the max record length via [s2n_config_set_send_buffer_size](https://aws.github.io/s2n-tls/doxygen/s2n_8h.html#a6de9d794c410474e9851880bd4914025), then s2n_send can buffer more than one record in `out` at a time before writing to the network. This reduces syscalls and can improve performance.
120120

121-
This feature does not signficantly impact the s2n_send logic: it really just makes the call to "s2n_flush" after each record is written to `out` conditional on whether or not there's enough space in `out` for another record.
121+
This feature does not significantly impact the s2n_send logic: it really just makes the call to "s2n_flush" after each record is written to `out` conditional on whether or not there's enough space in `out` for another record.
122122

123123
## Receiving Application Data
124124

@@ -128,7 +128,7 @@ Note: If you are unfamiliar with s2n_recv, read [the usage guide](https://github
128128

129129
### The header_in, in, and buffer_in buffers
130130

131-
Once upon a time, reading a record involved reading the TLS header into the fixed-sized `header_in` buffer and reading the payload into the `in` buffer. The `in` buffer was allocated with enough memory to hold the largest possible record fragment allowed by the RFC. This made `in` generally analagous to `out`, but often larger. If you're trying to understand most of the s2n_recv logic, this is still a useful mental model.
131+
Once upon a time, reading a record involved reading the TLS header into the fixed-sized `header_in` buffer and reading the payload into the `in` buffer. The `in` buffer was allocated with enough memory to hold the largest possible record fragment allowed by the RFC. This made `in` generally analogous to `out`, but often larger. If you're trying to understand most of the s2n_recv logic, this is still a useful mental model.
132132

133133
However, in reality, `in` no longer allocates *any* memory. Due to the addition of the "receive buffering" feature, `in` is now just a pointer to a subsection of `buffer_in`, and `buffer_in` is allocated with enough memory to hold the largest possible record allowed by the RFC. This is discussed further in the [Receive Buffering](#receive-buffering) section.
134134

@@ -146,7 +146,7 @@ The "s2n_peek" method can be used to check if any plaintext is waiting in `in`.
146146

147147
Historically, s2n_recv only read a single record each time it was called, regardless of how much application data the caller requested. Applications would need to call s2n_recv in a loop to read all expected data. This behavior has been maintained for backwards compatibility.
148148

149-
However, applications can also call [s2n_config_set_recv_multi_record](https://aws.github.io/s2n-tls/doxygen/s2n_8h.html#a873c1969c18fdf8663a9b593e62b9460) to instead read records in a loop until the expected amount of application data has been read. This feature does not signficantly impact the s2n_recv logic: it really just wrapped the previous implementation in a loop.
149+
However, applications can also call [s2n_config_set_recv_multi_record](https://aws.github.io/s2n-tls/doxygen/s2n_8h.html#a873c1969c18fdf8663a9b593e62b9460) to instead read records in a loop until the expected amount of application data has been read. This feature does not significantly impact the s2n_recv logic: it really just wrapped the previous implementation in a loop.
150150

151151
### Receive buffering
152152

docs/usage-guide/topics/ch07-io.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ or if called on a connection in a bad state.
192192

193193
`s2n_shutdown()` may also read and decrypt multiple application data records while waiting
194194
for the close_notify alert. This could result in calls to `s2n_shutdown()` taking a long
195-
time to complete. If this is a problem, `s2n_shutdown_send()` may be preferrable.
195+
time to complete. If this is a problem, `s2n_shutdown_send()` may be preferable.
196196
See [Closing the connection for writes](#closing-the-connection-for-writes) below.
197197

198198
Once `s2n_shutdown()` is complete:

0 commit comments

Comments
 (0)