Skip to content

Commit 7cef445

Browse files
committed
Setup typos checks
1 parent de26d7a commit 7cef445

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

.github/workflows/qa.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
schedule:
1313
- cron: '0 0 * * *'
1414

15+
env:
16+
CLICOLOR: 1
17+
1518
jobs:
1619
crystal:
1720
runs-on: ubuntu-latest
@@ -24,6 +27,12 @@ jobs:
2427
run: shards install --ignore-crystal-version
2528
- name: QA checks
2629
run: make qa
30+
spelling:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v5
34+
- name: Check spelling
35+
uses: crate-ci/[email protected]
2736
generated-app:
2837
runs-on: ubuntu-latest
2938
strategy:

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ format_checks:
6060
lint:
6161
bin/ameba
6262

63+
.PHONY: typos
64+
## Trigger spelling checks.
65+
typos:
66+
typos
67+
6368

6469
# TESTING
6570
# ~~~~~~~

_typos.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[default]
2+
extend-ignore-identifiers-re = [
3+
"Dentifiers",
4+
"enumerables",
5+
"reate",
6+
]
7+
extend-ignore-re = [
8+
# IPv4 (strict-ish 0-255)
9+
"\\b(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\b",
10+
11+
# IPv6 (covers the common forms, incl. "::" compression)
12+
"\\b(?:[0-9A-Fa-f]{1,4}:){1,7}[0-9A-Fa-f]{1,4}\\b",
13+
"\\b(?:[0-9A-Fa-f]{1,4}:){1,7}:\\b",
14+
"\\b:(?::[0-9A-Fa-f]{1,4}){1,7}\\b",
15+
]
16+
17+
[files]
18+
extend-exclude = [
19+
"docs/node_modules",
20+
"src/marten/locales",
21+
]

spec/marten/db/query/set_spec.cr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,11 +1432,11 @@ describe Marten::DB::Query::Set do
14321432
qset.to_a.should eq [tag_2]
14331433
end
14341434

1435-
it "raises an error when filtering with a misspelled column in a raw SQL condition", tags: "raw" do
1435+
it "raises an error when filtering with a non existing column in a raw SQL condition", tags: "raw" do
14361436
Tag.create!(name: "crystal", is_active: true)
14371437

14381438
expect_raises(Exception) do
1439-
Marten::DB::Query::Set(Tag).new.filter("namme=:name", name: "crystal").to_a
1439+
Marten::DB::Query::Set(Tag).new.filter("unknown=:name", name: "crystal").to_a
14401440
end
14411441
end
14421442

@@ -1930,11 +1930,11 @@ describe Marten::DB::Query::Set do
19301930
result.should eq tag_2
19311931
end
19321932

1933-
it "raises an error when getting with a misspelled column in a raw SQL condition", tags: "get_raw" do
1933+
it "raises an error when getting with a non existing column in a raw SQL condition", tags: "get_raw" do
19341934
Tag.create!(name: "crystal", is_active: true)
19351935

19361936
expect_raises(Exception) do
1937-
Marten::DB::Query::Set(Tag).new.get("namme=:name", name: "crystal")
1937+
Marten::DB::Query::Set(Tag).new.get("unknown=:name", name: "crystal")
19381938
end
19391939
end
19401940

0 commit comments

Comments
 (0)