Skip to content

Commit

Permalink
Typos exterminatus (#3619)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7d76b50370d725b7a4247ca4cecddf603d6bc93b)
  • Loading branch information
eustas committed Dec 3, 2024
1 parent 1d21e2c commit 2d6f862
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
#
- name: Checkout the source
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Install buildifier
- name: Install tools
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install buildifier typos-cli
Expand Down
9 changes: 9 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,15 @@ cmd_lint() {
# fi
#fi

# It is ok, if spell-checker is not installed.
if which typos >/dev/null; then
local src_ext="bazel|bzl|c|cc|cmake|gni|h|html|in|java|js|m|md|nix|py|rst|sh|ts|txt|yaml|yml"
local sources=`git -C ${MYDIR} ls-files | grep -E "\.(${src_ext})$"`
typos -c ${MYDIR}/tools/scripts/typos.toml ${sources}
else
echo "Consider installing https://github.com/crate-ci/typos for spell-checking"
fi

local installed=()
local clang_patch
local clang_format
Expand Down
32 changes: 32 additions & 0 deletions tools/scripts/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright (c) the JPEG XL Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file

[default]
extend-ignore-re = [
"(?Rm)^.*// notypo$", # disable check in current line
"// typo:off\\n(.*\\n)+\\s*// typo:on", # disable check in block
"0x[0-9a-fA-F]+[ ,u]", # hexadecimal literal
"clang-analyzer-optin",
]
extend-ignore-identifiers-re = []

[default.extend-words]
CNA = "CNA" # CVE Numbering Authority
ix = "ix"
iy = "iy"

[default.extend-identifiers]
APPn = "APPn" # JPEG APP marker N
cmsCreate_sRGBProfileTHR = "cmsCreate_sRGBProfileTHR"
cmsCreateTransformTHR = "cmsCreateTransformTHR"
cmsCreateXYZProfileTHR = "cmsCreateXYZProfileTHR"
cmsOpenProfileFromMemTHR = "cmsOpenProfileFromMemTHR"
cmsSetLogErrorHandlerTHR = "cmsSetLogErrorHandlerTHR"
hIST = "hIST" # histogram PNG chunk
JMSG_STR_PARM_MAX = "JMSG_STR_PARM_MAX" # jpeglib
msg_parm = "msg_parm" # jpeglib
PNGs = "PNGs"
YtoBRatio = "YtoBRatio"
YtoXRatio = "YtoXRatio"

0 comments on commit 2d6f862

Please sign in to comment.