Skip to content

Commit

Permalink
Run typos with a GitHub action on PRs (#1770)
Browse files Browse the repository at this point in the history
* update checkout and setup-node GH actions to v4

* add `typos` GH action + config

* remove glob matcher in `typos` action

* fix detected typos
  • Loading branch information
fturmel authored Nov 17, 2024
1 parent d91ec5e commit e70b99f
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests

name: Content tests
name: Content and unit tests

on:
push:
Expand All @@ -13,11 +13,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- run: npm ci
- run: npm test
19 changes: 19 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Content typos tests

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Check spelling in content directory
uses: crate-ci/typos@master
with:
files: ./content
2 changes: 1 addition & 1 deletion content/videos/archive/ml5/1-finding-keypoints/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"icon": "📓",
"title": "Humans of AI",
"url": "https://humans-of.ai/editorial/",
"description": "Philipp Schmitt's editorial essay on artifial intelligence and the human effort that went into creating the training dataset."
"description": "Philipp Schmitt's editorial essay on artificial intelligence and the human effort that went into creating the training dataset."
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"codeExamples": [
{
"title": "Polynomial Regression",
"description": "This sketch creates an interactive simulation of polynominal regression.",
"description": "This sketch creates an interactive simulation of polynomial regression.",
"urls": { "p5": "https://editor.p5js.org/codingtrain/sketches/UdXRZxF7e" }
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
},
{
"icon": "🔗",
"title": "The 'procesing-java' command",
"title": "The 'processing-java' command",
"url": "https://github.com/processing/processing/wiki/Command-Line",
"description": "Running Processing sketches from the command line"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{ "time": "16:44", "title": "Add the formulas" },
{ "time": "21:25", "title": "Simplify the code" },
{ "time": "22:57", "title": "Check for overlap" },
{ "time": "24:31", "title": "Check the particle's kinetic enery" },
{ "time": "24:31", "title": "Check the particle's kinetic energy" },
{ "time": "25:48", "title": "Fix error" },
{ "time": "27:30", "title": "Add more particles" },
{ "time": "30:11", "title": "Optimizations" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Catch The Sheeps (Game Concept)",
"title": "Catch The Sheep (Game Concept)",
"author": {
"name": "Leonardo M. Louzas",
"url": "https://github.com/leonardomlouzas"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"icon": "💻",
"title": "Humans of AI (Editorial Essay)",
"url": "https://humans-of.ai/editorial/",
"description": "Philipp Schmitt's editorial essay on artifial intelligence and the human effort that went into creating the training dataset."
"description": "Philipp Schmitt's editorial essay on artificial intelligence and the human effort that went into creating the training dataset."
},
{
"icon": "💻",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"time": "8:18",
"title": "Euler integraton"
"title": "Euler integration"
},
{
"time": "10:03",
Expand Down
10 changes: 10 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[default]
extend-ignore-re = [
# don't spellcheck the values of these JSON keys
'"(name|videoId|url|instagram)": ".*"',

# false positives
'Jason Sigal',
'Thi\.ng',
'Shure Lavalier',
]

0 comments on commit e70b99f

Please sign in to comment.