Skip to content

Commit 8ab8a1e

Browse files
authored
fix: Specify correct source path for lint-requirements.txt; Prevent lint:venv from running unnecessarily. (#20)
1 parent b92875f commit 8ab8a1e

File tree

5 files changed

+45
-42
lines changed

5 files changed

+45
-42
lines changed

taskfile.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ vars:
99
G_BUILD_DIR: "{{.ROOT_DIR}}/build"
1010
G_CMAKE_CACHE: "{{.G_BUILD_DIR}}/CMakeCache.txt"
1111
G_COMPILE_COMMANDS_DB: "{{.G_BUILD_DIR}}/compile_commands.json"
12-
# Project-specific variables
13-
G_YSTDLIB_CPP_SRC_DIR: "{{.ROOT_DIR}}/src/ystdlib"
12+
G_CPP_SRC_DIR: "{{.ROOT_DIR}}/src"
1413

1514
tasks:
1615
clean:

taskfiles/lint-cmake.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ tasks:
55
desc: "Runs the CMake linters."
66
sources: &cmake_format_src_files
77
- "{{.G_LINT_VENV_CHECKSUM_FILE}}"
8-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/.gersemirc"
98
- "{{.ROOT_DIR}}/**/*.cmake"
109
- "{{.ROOT_DIR}}/**/*.cmake.in"
1110
- "{{.ROOT_DIR}}/**/CMakeLists.txt"

taskfiles/lint-cpp.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ tasks:
1717
desc: "Runs the C++ linters that identify formatting issues."
1818
sources: &cpp_format_src_files
1919
- "{{.G_LINT_VENV_CHECKSUM_FILE}}"
20-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.cpp"
21-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.h"
22-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.hpp"
20+
- "{{.G_CPP_SRC_DIR}}/**/*.cpp"
21+
- "{{.G_CPP_SRC_DIR}}/**/*.h"
22+
- "{{.G_CPP_SRC_DIR}}/**/*.hpp"
2323
- "{{.ROOT_DIR}}/.clang-format"
2424
- "{{.TASKFILE}}"
2525
deps:
@@ -52,16 +52,16 @@ tasks:
5252
# NOTE: clang-tidy does have the ability to fix some errors, but the fixes can be inaccurate.
5353
# When we eventually determine which errors can be safely fixed, we'll allow clang-tidy to
5454
# fix them.
55-
desc: "Runs the C++ static analyzers. Only checks for warnings and violations."
5655
aliases:
5756
- "cpp-static-fix"
57+
desc: "Runs the C++ static analyzers. Only checks for warnings and violations."
5858
sources:
5959
- "{{.G_CMAKE_CACHE}}"
6060
- "{{.G_COMPILE_COMMANDS_DB}}"
6161
- "{{.G_LINT_VENV_CHECKSUM_FILE}}"
62-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.cpp"
63-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.h"
64-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}/**/*.hpp"
62+
- "{{.G_CPP_SRC_DIR}}/**/*.cpp"
63+
- "{{.G_CPP_SRC_DIR}}/**/*.h"
64+
- "{{.G_CPP_SRC_DIR}}/**/*.hpp"
6565
- "{{.ROOT_DIR}}/.clang-tidy"
6666
- "{{.TASKFILE}}"
6767
deps:

taskfiles/lint-venv.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: "3"
2+
3+
tasks:
4+
venv:
5+
internal: true
6+
vars:
7+
CHECKSUM_FILE: "{{.G_LINT_VENV_CHECKSUM_FILE}}"
8+
OUTPUT_DIR: "{{.G_LINT_VENV_DIR}}"
9+
sources:
10+
- "{{.ROOT_DIR}}/taskfile.yaml"
11+
- "{{.TASKFILE}}"
12+
- "{{.ROOT_DIR}}/lint-requirements.txt"
13+
generates:
14+
- "{{.CHECKSUM_FILE}}"
15+
run: "once"
16+
deps:
17+
- ":init"
18+
- task: ":utils:validate-checksum"
19+
vars:
20+
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
21+
DATA_DIR: "{{.OUTPUT_DIR}}"
22+
cmds:
23+
- task: ":utils:create-venv"
24+
vars:
25+
LABEL: "lint"
26+
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
27+
REQUIREMENTS_FILE: "{{.ROOT_DIR}}/lint-requirements.txt"
28+
# This command must be last
29+
- task: ":utils:compute-checksum"
30+
vars:
31+
DATA_DIR: "{{.OUTPUT_DIR}}"
32+
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"

taskfiles/lint.yaml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ includes:
77
cpp:
88
flatten: true
99
taskfile: "./lint-cpp.yaml"
10+
venv:
11+
flatten: true
12+
taskfile: "./lint-venv.yaml"
1013
yaml:
1114
flatten: true
1215
taskfile: "./lint-yaml.yaml"
1316

1417
vars:
18+
G_LINT_CPP_DIRS:
19+
- "{{.G_CPP_SRC_DIR}}"
1520
G_LINT_VENV_DIR: "{{.G_BUILD_DIR}}/lint-venv"
1621
G_LINT_VENV_CHECKSUM_FILE: "{{.G_BUILD_DIR}}/lint#venv.md5"
17-
G_LINT_CPP_DIRS:
18-
- "{{.G_YSTDLIB_CPP_SRC_DIR}}"
1922

2023
tasks:
2124
check:
@@ -31,33 +34,3 @@ tasks:
3134
- task: "cmake-fix"
3235
- task: "cpp-fix"
3336
- task: "yaml-fix"
34-
35-
venv:
36-
internal: true
37-
vars:
38-
CHECKSUM_FILE: "{{.G_LINT_VENV_CHECKSUM_FILE}}"
39-
OUTPUT_DIR: "{{.G_LINT_VENV_DIR}}"
40-
sources:
41-
- "{{.ROOT_DIR}}/taskfile.yaml"
42-
- "{{.TASKFILE}}"
43-
- "lint-requirements.txt"
44-
generates:
45-
- "{{.CHECKSUM_FILE}}"
46-
run: "once"
47-
deps:
48-
- ":init"
49-
- task: ":utils:validate-checksum"
50-
vars:
51-
CHECKSUM_FILE: "{{.CHECKSUM_FILE}}"
52-
DATA_DIR: "{{.OUTPUT_DIR}}"
53-
cmds:
54-
- task: ":utils:create-venv"
55-
vars:
56-
LABEL: "lint"
57-
OUTPUT_DIR: "{{.OUTPUT_DIR}}"
58-
REQUIREMENTS_FILE: "lint-requirements.txt"
59-
# This command must be last
60-
- task: ":utils:compute-checksum"
61-
vars:
62-
DATA_DIR: "{{.OUTPUT_DIR}}"
63-
OUTPUT_FILE: "{{.CHECKSUM_FILE}}"

0 commit comments

Comments
 (0)