mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 16:20:51 +00:00
codespell: Exclude paths by patterns following pre-commit check conventions
In order to share `.codespellrc` between our CI checks and `pre-commit` checks, we need to match paths without the leading `./`. Convert to a `bash` script so we can use `dotglob` to pass paths explicitly. Unfortunately this means we can no longer run `codespell` manually with no arguments. Instead we can run `.gitlab/ci/codespell.bash`.
This commit is contained in:
23
.codespellrc
23
.codespellrc
@@ -5,18 +5,19 @@ check-hidden =
|
|||||||
quiet-level = 2
|
quiet-level = 2
|
||||||
builtin = clear,rare,en-GB_to_en-US
|
builtin = clear,rare,en-GB_to_en-US
|
||||||
|
|
||||||
|
# Skip paths matching fnmatch glob patterns.
|
||||||
skip =
|
skip =
|
||||||
*/.git,
|
.git,
|
||||||
*/build,
|
build,
|
||||||
*/Copyright.txt,
|
Copyright.txt,
|
||||||
*/CTestCustom.cmake.in,
|
CTestCustom.cmake.in,
|
||||||
*/Modules/Internal/CPack/NSIS.template.in,
|
Modules/Internal/CPack/NSIS.template.in,
|
||||||
*/Source/CursesDialog/form/*,
|
Source/CursesDialog/form/*,
|
||||||
*/Source/kwsys/*,
|
Source/kwsys/*,
|
||||||
*/Tests/RunCMake/CPack/tests/DMG_SLA/German.*,
|
Tests/RunCMake/CPack/tests/DMG_SLA/German.*,
|
||||||
*/Tests/RunCMake/ParseImplicitData/*.input,
|
Tests/RunCMake/ParseImplicitData/*.input,
|
||||||
*/Tests/StringFileTest/test.utf8,
|
Tests/StringFileTest/test.utf8,
|
||||||
*/Utilities/cm*,
|
Utilities/cm*,
|
||||||
*.pfx,
|
*.pfx,
|
||||||
|
|
||||||
ignore-words-list =
|
ignore-words-list =
|
||||||
|
|||||||
@@ -4,8 +4,12 @@ set -e
|
|||||||
|
|
||||||
result=0
|
result=0
|
||||||
|
|
||||||
|
# 'codespell' with no arguments adds a leading './' to all paths.
|
||||||
|
# Avoid that by globbing top-level entries explicitly.
|
||||||
|
shopt -s dotglob
|
||||||
echo "Running 'codespell' on source code..."
|
echo "Running 'codespell' on source code..."
|
||||||
codespell || result=1
|
codespell * || result=1
|
||||||
|
shopt -u dotglob
|
||||||
|
|
||||||
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
|
if [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
|
||||||
for COMMIT in $(git rev-list "^$CI_MERGE_REQUEST_DIFF_BASE_SHA" "$CI_COMMIT_SHA"); do
|
for COMMIT in $(git rev-list "^$CI_MERGE_REQUEST_DIFF_BASE_SHA" "$CI_COMMIT_SHA"); do
|
||||||
@@ -584,7 +584,7 @@
|
|||||||
stage: build
|
stage: build
|
||||||
extends: .fedora41
|
extends: .fedora41
|
||||||
script:
|
script:
|
||||||
- .gitlab/ci/codespell.sh
|
- .gitlab/ci/codespell.bash
|
||||||
interruptible: true
|
interruptible: true
|
||||||
|
|
||||||
.cmake_build_linux:
|
.cmake_build_linux:
|
||||||
|
|||||||
Reference in New Issue
Block a user