Skip to content

Commit a5b4980

Browse files
committed
Tweaks in lint-all.sh
1 parent 65bb78e commit a5b4980

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

papers/P2988/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ SPDX-License-Identifier: 2.0 license with LLVM exceptions
99
Compiling the paper requires a working LaTeX installation. See instructions for configuring your system at [C++ Standard Draft Sources](https://github.com/cplusplus/draft/blob/main/README.rst)
1010

1111
The papers/ subdirectory has the LaTeX souces for P2988 and the supporting macro definitions. To build, run
12+
1213
```shell
1314
make papers
1415
```

scripts/lint-all.sh

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,50 @@
1010
set -e
1111
set -x
1212

13+
BASE_DIRS=(
14+
include
15+
examples
16+
scripts
17+
src
18+
)
1319
# Lint all C++ files in the project.
14-
find include/ examples/ src/ -name "*.h" -o -name "*.cpp" | xargs clang-format -i -style=file || echo "clang-format failed."
20+
CPP_DIRS=(
21+
"${BASE_DIRS[@]}"
22+
)
23+
find -E "${CPP_DIRS[@]}" -regex '.*\.(h|hpp|hxx|cpp|c|cxx)' | xargs clang-format -i -style=file || echo "clang-format failed."
1524
echo "All C++ files were linted."
1625

1726
# Lint all scripts in the project.
18-
find scripts/ -name "*.sh" | xargs shellcheck || echo "shellcheck failed."
27+
SHELL_DIRS=(
28+
"${BASE_DIRS[@]}"
29+
)
30+
find -E "${SHELL_DIRS[@]}" -regex '.*\.(sh)' | xargs shellcheck || echo "shellcheck failed."
1931
echo "All scripts files were linted."
2032

2133
# Lint all CMake files in the project.
22-
find . -name CMakeLists.txt | xargs cmake-format -i || echo "cmake-format failed."
34+
CMAKE_DIRS=(
35+
CMakeLists.txt
36+
"${BASE_DIRS[@]}"
37+
cmake
38+
)
39+
find -E "${CMAKE_DIRS[@]}" -regex '.*CMakeLists\.txt' | xargs cmake-format -i || echo "cmake-format failed."
2340
echo "All CMake files were linted."
2441

2542
# Lint all Markdown files in the project.
26-
find README.md examples/ -name "*.md" | xargs markdownlint -f || echo "markdownlint failed."
43+
MD_DIRS=(
44+
README.md
45+
"${BASE_DIRS[@]}"
46+
papers/P2988/README.md
47+
)
48+
find -E "${MD_DIRS[@]}" -regex '.*\.(md)' | xargs markdownlint -f || echo "markdownlint failed."
2749
echo "All Markdown files were linted."
2850

2951
# Lint all YAML files in the project.
30-
find . -name "*.yaml" -o -name "*.yml" | xargs yamlfmt || echo "yamlfmt failed."
52+
YAML_DIRS=(
53+
.github/
54+
"${BASE_DIRS[@]}"
55+
)
56+
find -E "${YAML_DIRS[@]}" -regex '.*\.(yml)' | xargs yamlfmt || echo "yamlfmt failed."
3157
echo "All YAML files were linted."
3258

33-
# TODO: Lint all JSON files in the project.
34-
# echo "All JSON files were linted."
35-
3659
echo "All linters finished."

0 commit comments

Comments
 (0)