Add CI job to check typos

This commit is contained in:
syeopite 2025-06-06 18:43:08 -07:00
parent df8839d1f0
commit c528b0f866
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
3 changed files with 43 additions and 0 deletions

View File

@ -20,6 +20,10 @@ Lint/ShadowingOuterLocalVar:
Excluded: Excluded:
- src/invidious/helpers/tokens.cr - src/invidious/helpers/tokens.cr
# CI has a separate job to check for typos
Lint/Typos:
Enabled: false
Lint/NotNil: Lint/NotNil:
Enabled: false Enabled: false

View File

@ -165,3 +165,12 @@ jobs:
- name: Run Ameba linter - name: Run Ameba linter
run: bin/ameba run: bin/ameba
lint_spell:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Spell Check Repo
uses: crate-ci/typos@v1.33.1

30
.typos.toml Normal file
View File

@ -0,0 +1,30 @@
[default]
extend-ignore-re = [
# Exclude various hard-coded YouTube IDs
"\\b[0-9A-z+/\\-_]{100,}((=|%3D){1,2})?\\b",
"\\b4qm.*(%3D{1,2})?\\b",
"UC[A-z0-9\\-]*\\b",
"EgI[A-z0-9\\-]{7}(%3D{1,2})",
# Ignore gsub regex
"gsub\\(?/.*/,?",
# TEST_IDs constant def
"TEST_IDS *= *\\{.*\\}",
# Ignore two-letter region strings
"(\\b|\")[a-zA-Z]{2}(\\b|\"),"
]
[default.extend-identifiers]
clen = "clen"
[files]
extend-exclude = [
"/assets/js/videojs-youtube-annotations.min.js",
"/assets/videojs/**/*",
"/assets/fonts/ionicons.svg",
"/mocks/**/*.json",
"locales/*.json",
"CHANGELOG_legacy.md",
]