Skip to content

Commit 792751f

Browse files
author
Martin Taillefer
committed
ci: Add spell checker
1 parent e095f6a commit 792751f

File tree

27 files changed

+123
-320
lines changed

27 files changed

+123
-320
lines changed

.github/license-check/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
{
4646
"include": [
47+
"**/*.dic",
4748
"**/*.j2",
4849
"**/*.svg",
4950
"**/*.png",

.github/workflows/main.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,72 @@ jobs:
153153
if: success() || failure()
154154
run: cargo deny --all-features --workspace --color always check all
155155

156+
spell-check:
157+
needs: constants
158+
runs-on: ubuntu-latest
159+
env:
160+
CARGO_WORKSPACES_VERSION: ${{ needs.constants.outputs.CARGO_WORKSPACES_VERSION }}
161+
SCCACHE_VERSION: ${{ needs.constants.outputs.SCCACHE_VERSION }}
162+
SCCACHE_GHA_ENABLED: "true"
163+
RUSTC_WRAPPER: "sccache"
164+
steps:
165+
# prep
166+
- name: Checkout
167+
uses: actions/checkout@v6.0.0
168+
with:
169+
fetch-depth: 1
170+
- name: Cache Cargo Dependencies
171+
uses: actions/cache@v4.3.0
172+
with:
173+
path: |
174+
~/.cargo/bin/
175+
~/.cargo/registry/index/
176+
~/.cargo/registry/cache/
177+
~/.cargo/git/db/
178+
key: ${{ runner.os }}-cargo-tools-${{ hashFiles('**/Cargo.lock') }}
179+
- name: Start sccache
180+
uses: mozilla-actions/sccache-action@v0.0.9
181+
with:
182+
version: ${{ env.SCCACHE_VERSION }}
183+
- name: Install Rust
184+
uses: actions-rust-lang/setup-rust-toolchain@v1.15.2
185+
with:
186+
toolchain: ${{ env.RUST_LATEST }}
187+
- name: Install Cargo Tools
188+
uses: taiki-e/install-action@v2.62.62
189+
with:
190+
tool: cargo-spellcheck
191+
192+
# execute
193+
- name: Generate dictionary from .spelling file
194+
run: |
195+
# Read .spelling file, sort, deduplicate, and generate spellcheck.dic
196+
# Sort with LC_ALL=en_US.UTF8 for consistency across environments
197+
198+
# Remove empty lines, sort, and deduplicate
199+
sorted_words=$(grep -v '^$' .spelling | LC_ALL=en_US.UTF8 sort -u)
200+
201+
# Count the words
202+
word_count=$(echo "$sorted_words" | wc -l | xargs)
203+
204+
# Generate spellcheck.dic with count on first line
205+
echo "$word_count" > spellcheck.dic
206+
echo "$sorted_words" >> spellcheck.dic
207+
208+
echo "Generated spellcheck.dic with $word_count words"
209+
- name: Run cargo-spellcheck
210+
run: |
211+
if ! cargo spellcheck --cfg spellcheck.toml --code 1
212+
then
213+
echo ''
214+
echo ''
215+
echo 'If this is a Rust method/type/variable name, then you should'
216+
echo 'enclose it in backticks like this: `MyRustType`.'
217+
echo ''
218+
echo 'If this is a real word, then you can add it to .spelling'
219+
exit 1
220+
fi
221+
156222
semver:
157223
needs: constants
158224
if: github.event_name == 'pull_request'

.spelling

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Clippy
6767
codebase
6868
composability
6969
config
70+
contoso
7071
const
7172
CONTRIBUTING.md
7273
coverage.json
@@ -99,6 +100,7 @@ filesystem
99100
fn
100101
foldhash
101102
footguns
103+
formatter
102104
fundle
103105
Fundle
104106
getsockopt
@@ -133,6 +135,7 @@ macros
133135
Macros
134136
Makefile
135137
metadata
138+
metadata
136139
Metas
137140
Microservices
138141
microsoft.com
@@ -245,4 +248,5 @@ wildcard
245248
wildcards
246249
Win32
247250
winsock
251+
workspace
248252
Xamarin

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33

44
[workspace]
5-
resolver = "3"
5+
resolver = "2"
66
members = ["crates/*"]
77

88
[workspace.package]

crates/bytesbuf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ use bytesbuf::BytesView;
422422

423423
pub fn write(&mut self, message: BytesView) {
424424
// We now need to identify whether the message actually uses memory that allows us to
425-
// ues the optimal I/O path. There is no requirement that the data passed to us contains
425+
// use the optimal I/O path. There is no requirement that the data passed to us contains
426426
// only memory with our preferred configuration.
427427

428428
let use_optimal_path = message.iter_slice_metas().all(|meta| {

crates/bytesbuf/examples/bb_optimal_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Connection {
6161

6262
pub fn write(&mut self, message: BytesView) {
6363
// We now need to identify whether the message actually uses memory that allows us to
64-
// ues the optimal I/O path. There is no requirement that the data passed to us contains
64+
// use the optimal I/O path. There is no requirement that the data passed to us contains
6565
// only memory with our preferred configuration.
6666

6767
let use_optimal_path = message.iter_slice_metas().all(|meta| {

crates/bytesbuf/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@
456456
//! # impl Foo {
457457
//! pub fn write(&mut self, message: BytesView) {
458458
//! // We now need to identify whether the message actually uses memory that allows us to
459-
//! // ues the optimal I/O path. There is no requirement that the data passed to us contains
459+
//! // use the optimal I/O path. There is no requirement that the data passed to us contains
460460
//! // only memory with our preferred configuration.
461461
//!
462462
//! let use_optimal_path = message.iter_slice_metas().all(|meta| {

crates/bytesbuf/src/span_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl SpanBuilder {
167167
// This cannot overflow - guarded by assertion above.
168168
self.filled_bytes = self.filled_bytes.wrapping_sub(len.get());
169169

170-
// SAFETY: We only seeked over filled bytes, so we must still be in-bounds.
170+
// SAFETY: We only skipped over filled bytes, so we must still be in-bounds.
171171
self.start = unsafe { self.start.add(len.get() as usize) };
172172

173173
span

crates/data_privacy/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
- ✨ Features
7575

76-
- Make RedactionEngine clonable. ([#13](https://github.com/microsoft/oxidizer/pull/13))
76+
- Make RedactionEngine cloneable. ([#13](https://github.com/microsoft/oxidizer/pull/13))
7777

7878
- 📚 Documentation
7979

crates/data_privacy/src/data_class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl DataClass {
2525
///
2626
/// # Panics
2727
///
28-
/// Panics if `taxonomy` or `name` are not valid ASCII identifiers. Valid identifiers must
28+
/// Panics if `taxonomy` or `name` are not valid identifiers. Valid identifiers must
2929
/// start with `_` or an ASCII letter, followed by zero or more `_`, ASCII letters, or ASCII
3030
/// digits (e.g., `foo`, `_bar`, `Baz123`)
3131
#[must_use]

0 commit comments

Comments
 (0)