Skip to content

Commit 6aa2b83

Browse files
authored
Enable Codespell (#128)
* Enable Codespell * Oops checkout code before spellchecking * Only run tests once! * Ignore juxt * Learn to spell Cam! * Fix spellings
1 parent 367a6c4 commit 6aa2b83

File tree

13 files changed

+36
-16
lines changed

13 files changed

+36
-16
lines changed

.codespellignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
edn
2+
juxt
3+
methodd

.codespellrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = ./.git,./target,./.clj-kondo/.cache
3+
ignore-words = .codespellignore

.github/workflows/tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Tests
22

33
on:
44
push:
5+
branches:
6+
- master
57
pull_request:
68

79
jobs:
@@ -212,3 +214,11 @@ jobs:
212214
uses: codecov/codecov-action@v3
213215
with:
214216
files: ./target/coverage/codecov.json
217+
218+
codespell:
219+
runs-on: ubuntu-20.04
220+
steps:
221+
- uses: actions/checkout@v3
222+
- uses: codespell-project/actions-codespell@v1
223+
with:
224+
ignore_words_file: .codespellignore

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ coverage:
88
default:
99
# Project must always have at least 80% coverage (by line)
1010
target: 80%
11-
# Whole-project test coverage is allowed to drop up to 5%. (For situtations where we delete code with full coverage)
11+
# Whole-project test coverage is allowed to drop up to 5%. (For situations where we delete code with full coverage)
1212
threshold: 5%
1313
patch:
1414
default:

scripts/lint-and-test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
# This script is a convenience for running linters and tests without having to type in a bunch of nonsense.
44

5+
# switch to project root directory if we're not already there
6+
script_directory=`dirname "${BASH_SOURCE[0]}"`
7+
cd "$script_directory/.."
8+
59
set -euxo pipefail
610

7-
clj-kondo --parallel --lint src test toucan1/src/ toucan1/test/
11+
codespell
812

913
clojure -X:dev:test $@

src/toucan2/execute.clj

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

114114
(defmacro with-call-count
115115
"Execute `body`, trackingthe number of database queries and statements executed. This number can be fetched at any
116-
time withing `body` by calling function bound to `call-count-fn-binding`:
116+
time within `body` by calling function bound to `call-count-fn-binding`:
117117
118118
```clj
119119
(with-call-count [call-count]

src/toucan2/log.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
nil)
2828

2929
(defonce ^{:doc "The default log level to log messages directly to stdout with. Takes the value of the env var
30-
`TOUCAN_DEBUG_LEVEL`, if set. Can be overriden with [[*level*]]. This is stored as an atom, so you can `swap!` or
30+
`TOUCAN_DEBUG_LEVEL`, if set. Can be overridden with [[*level*]]. This is stored as an atom, so you can `swap!` or
3131
`reset!` it."} level
3232
(atom (some-> (env/env :toucan-debug-level) keyword)))
3333

src/toucan2/map_backend/honeysql2.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
(defn condition->honeysql-where-clause
3838
"Something sequential like `:id [:> 5]` becomes `[:> :id 5]`. Other stuff like `:id 5` just becomes `[:= :id 5]`."
3939
[k v]
40-
;; don't think there's any situtation where `nil` on the LHS is on purpose and not a bug.
40+
;; don't think there's any situation where `nil` on the LHS is on purpose and not a bug.
4141
{:pre [(some? k)]}
4242
(if (sequential? v)
4343
(fn-condition->honeysql-where-clause k v)

toucan1/src/toucan/models.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@
327327
```"
328328
[modelable]
329329
(let [model (model/resolve-model modelable)]
330-
;; programatically try all the hydration methods with `[:default <k>]` dispatch values and see which of them returns
330+
;; programmatically try all the hydration methods with `[:default <k>]` dispatch values and see which of them returns
331331
;; our `model` when invoked. This is a totally wacky way of doing this. But it lets us introspect things even if
332332
;; they weren't defined with [[define-hydration-keys]].
333333
(for [[dispatch-value f] (m/primary-methods hydrate/model-for-automagic-hydration)

toucan1/test/toucan/models_test.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,16 +414,16 @@
414414
(test/with-discarded-table-changes Category
415415
(is (= true
416416
(t1.db/delete! Category :id 1)))
417-
(is (= #{{:id 3, :name "resturaunt", :parent-category-id nil}
418-
{:id 4, :name "mexican-resturaunt", :parent-category-id 3}}
417+
(is (= #{{:id 3, :name "restaurant", :parent-category-id nil}
418+
{:id 4, :name "mexican-restaurant", :parent-category-id 3}}
419419
(set (t1.db/select Category)))))
420420
(testing "shouldn't delete anything else if the Category is not parent of anybody else"
421421
(test/with-discarded-table-changes Category
422422
(is (= true
423423
(t1.db/delete! Category :id 2)))
424424
(is (= #{{:id 1, :name "bar", :parent-category-id nil}
425-
{:id 3, :name "resturaunt", :parent-category-id nil}
426-
{:id 4, :name "mexican-resturaunt", :parent-category-id 3}}
425+
{:id 3, :name "restaurant", :parent-category-id nil}
426+
{:id 4, :name "mexican-restaurant", :parent-category-id 3}}
427427
(set (t1.db/select Category)))))))
428428

429429
;; (def ^:private pre-deleted (atom []))

0 commit comments

Comments
 (0)