Skip to content

Commit aff2777

Browse files
committed
buildchain: Change the way we handle lint codegen
Use task_dep instead of combinating actions
1 parent 079e9a6 commit aff2777

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

buildchain/buildchain/codegen.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,6 @@
1414
from buildchain import utils
1515

1616

17-
def get_task_information() -> types.TaskDict:
18-
"""Retrieve all the task information from codegen"""
19-
result: types.TaskDict = {
20-
"actions": [],
21-
"task_dep": [],
22-
"file_dep": [],
23-
}
24-
for task_fun in CODEGEN:
25-
task = task_fun()
26-
for key, value in result.items():
27-
value.extend(task.get(key, []))
28-
29-
return result
30-
31-
3217
def task_codegen() -> Iterator[types.TaskDict]:
3318
"""Run the code generation tools."""
3419
for create_codegen_task in CODEGEN:

buildchain/buildchain/lint.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
from buildchain import constants
4242
from buildchain import types
4343
from buildchain import utils
44-
from buildchain import codegen
4544

4645

4746
def task_lint() -> Iterator[types.TaskDict]:
@@ -195,16 +194,13 @@ def lint_codegen() -> types.TaskDict:
195194
git_diff = [config.ExtCommand.GIT.value, "diff"]
196195
base = subprocess.check_output(git_diff)
197196

198-
task = codegen.get_task_information()
199-
task["actions"].append(lambda: check_diff_codegen(base))
200-
task.update(
201-
{
202-
"name": "codegen",
203-
"title": utils.title_with_subtask_name("LINT"),
204-
"doc": lint_codegen.__doc__,
205-
}
206-
)
207-
return task
197+
return {
198+
"name": "codegen",
199+
"title": utils.title_with_subtask_name("LINT"),
200+
"doc": lint_codegen.__doc__,
201+
"actions": [lambda: check_diff_codegen(base)],
202+
"task_dep": ["codegen"],
203+
}
208204

209205

210206
# }}}

0 commit comments

Comments
 (0)