mirror of
https://github.com/curl/curl.git
synced 2026-07-24 15:17:15 +03:00
cmake: match filename suffixes with file content
To: - simplify recognizing CMake sources. - ensure syntax highlighters use the correct file type. - sync .h template filename with its autotools counterpart. Also: - cmakelint.sh: simplify, alpha sort the filelist. - perlcheck.sh: simplify. Closes #20039
This commit is contained in:
parent
7ded0e21cd
commit
1892286086
12 changed files with 23 additions and 28 deletions
|
|
@ -45,15 +45,13 @@ cd "$(dirname "$0")"/..
|
|||
|
||||
{
|
||||
if [ -n "${1:-}" ]; then
|
||||
for A in "$@"; do printf "%s\n" "$A"; done
|
||||
for A in "$@"; do printf '%s\n' "$A"; done
|
||||
elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
git ls-files
|
||||
git ls-files '**CMakeLists.txt' '*.cmake'
|
||||
else
|
||||
# strip off the leading ./ to make the grep regexes work properly
|
||||
find . -type f | sed 's@^\./@@'
|
||||
find . -type f \( -name 'CMakeLists.txt' -o -name '*.cmake' \)
|
||||
fi
|
||||
} | grep -E '(^CMake|/CMake|\.cmake$|\.cmake\.in$)' | grep -v -E '(\.h\.cmake|\.c)$' \
|
||||
| xargs \
|
||||
} | sort | xargs \
|
||||
cmake-lint \
|
||||
--suppress-decorations \
|
||||
--disable \
|
||||
|
|
|
|||
|
|
@ -38,14 +38,11 @@ echo "parallel: ${procs}"
|
|||
|
||||
{
|
||||
if [ -n "${1:-}" ]; then
|
||||
for A in "$@"; do printf "%s\n" "$A"; done
|
||||
for A in "$@"; do printf '%s\n' "$A"; done
|
||||
elif git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
{
|
||||
git ls-files | grep -E '\.(pl|pm)$'
|
||||
git grep -l '^#!/usr/bin/env perl'
|
||||
} | sort -u
|
||||
git ls-files '*.pl' '*.pm'
|
||||
git grep -l '^#!/usr/bin/env perl'
|
||||
else
|
||||
# strip off the leading ./ to make the grep regexes work properly
|
||||
find . -type f \( -name '*.pl' -o -name '*.pm' \) | sed 's@^\./@@'
|
||||
find . -type f \( -name '*.pl' -o -name '*.pm' \)
|
||||
fi
|
||||
} | xargs -n 1 -P "${procs}" perl -c -Itests --
|
||||
} | sort -u | xargs -n 1 -P "${procs}" perl -c -Itests --
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue