1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
{ "targets":
{ "doc":
[ "Run a given linter on the lint information provided by the given targets."
]
, "target_fields": ["linter", "config", "summarizer", "targets"]
, "tainted": ["lint"]
, "field_doc":
{ "linter":
[ "Single artifact running the lint checks."
, ""
, "This artifact with"
, "- argv[1] the file to lint, and"
, "- argv[2:] the original command line."
, "This invocation happens in an environment with"
, "- CONFIG pointing to the directory with all the artifacts given"
, " by the field \"config\"."
, "- OUT pointing to a directory to which files with the lint result"
, " can be written."
, "The linter is supposed to indicate by the exit code whether the"
, "indicated file complies with the given linting policy, with 0 meaning"
, "compliant."
, "Stdout and stderr, as well as the directory ${OUT} can be used to"
, "provide additional information."
]
, "config": ["Any configuration or other files needed by the linter."]
, "summarizer":
[ "Single artifact generating a summary of the individual lint results."
, "It will be called in a directory where all subdirectories with names"
, "consisting entirely of digits are the results of the individual lint"
, "actions. Those are given as"
, " - a file result with content PASS if and only if the lint action"
, " exited 0,"
, " - files stdout and stderr with stdout and stderr of the lint"
, " action, and"
, " - a directory out with the additional information provided by the"
, " lint action."
, "The summarizer is required to indicate the overall result by the exit"
, "code, produce a human-readable summary on stdout, and optionally"
, "additional information in the directory ${OUT}."
]
, "call_lint": ["Launcher for the linter"]
, "call_summary": ["Launcher for the summarizer"]
}
, "implicit": {"call_lint": ["call_lint"], "call_summary": ["call_summary"]}
, "config_transitions":
{"targets": [{"type": "singleton_map", "key": "LINT", "value": true}]}
, "anonymous":
{"lint": {"target": "targets", "provider": "lint", "rule_map": {}}}
, "imports":
{ "stage": ["", "stage_singleton_field"]
, "artifacts": ["", "field_artifacts"]
}
, "expression":
{ "type": "let*"
, "bindings":
[ [ "linter"
, { "type": "let*"
, "bindings": [["fieldname", "linter"], ["location", "linter"]]
, "body": {"type": "CALL_EXPRESSION", "name": "stage"}
}
]
, [ "runner"
, { "type": "let*"
, "bindings": [["fieldname", "call_lint"], ["location", "runner"]]
, "body": {"type": "CALL_EXPRESSION", "name": "stage"}
}
]
, [ "config"
, { "type": "let*"
, "bindings": [["fieldname", "config"]]
, "body": {"type": "CALL_EXPRESSION", "name": "artifacts"}
}
]
, [ "lint results"
, { "type": "foreach"
, "range": {"type": "FIELD", "name": "lint"}
, "body":
{ "type": "let*"
, "bindings":
[ [ "src"
, { "type": "DEP_PROVIDES"
, "dep": {"type": "var", "name": "_"}
, "provider": "src"
}
]
, [ "cmd"
, { "type": "DEP_PROVIDES"
, "dep": {"type": "var", "name": "_"}
, "provider": "cmd"
}
]
, [ "src input"
, { "type": "DEP_ARTIFACTS"
, "dep": {"type": "var", "name": "_"}
}
]
]
, "body":
{ "type": "TREE"
, "$1":
{ "type": "ACTION"
, "inputs":
{ "type": "map_union"
, "$1":
[ {"type": "var", "name": "runner"}
, {"type": "var", "name": "linter"}
, { "type": "to_subdir"
, "subdir": "work"
, "$1": {"type": "var", "name": "src input"}
}
, { "type": "to_subdir"
, "subdir": "config"
, "$1": {"type": "var", "name": "config"}
}
]
}
, "cmd":
{ "type": "++"
, "$1":
[ ["./runner", {"type": "var", "name": "src"}]
, {"type": "var", "name": "cmd"}
]
}
, "outs": ["stdout", "stderr", "result"]
, "out_dirs": ["out"]
, "may_fail": ["lint"]
, "fail_message":
{ "type": "join"
, "$1": ["lint failed for ", {"type": "var", "name": "src"}]
}
}
}
}
}
]
, [ "lint results"
, {"type": "nub_right", "$1": {"type": "var", "name": "lint results"}}
]
, [ "summary input"
, {"type": "enumerate", "$1": {"type": "var", "name": "lint results"}}
]
, [ "summarizer"
, { "type": "let*"
, "bindings":
[["fieldname", "summarizer"], ["location", "summarizer"]]
, "body": {"type": "CALL_EXPRESSION", "name": "stage"}
}
]
, [ "runner"
, { "type": "let*"
, "bindings": [["fieldname", "call_summary"], ["location", "runner"]]
, "body": {"type": "CALL_EXPRESSION", "name": "stage"}
}
]
, [ "summary"
, { "type": "ACTION"
, "inputs":
{ "type": "map_union"
, "$1":
[ {"type": "var", "name": "runner"}
, {"type": "var", "name": "summarizer"}
, { "type": "to_subdir"
, "subdir": "work"
, "$1": {"type": "var", "name": "summary input"}
}
]
}
, "cmd": ["./runner"]
, "outs": ["report", "result"]
, "out_dirs": ["out"]
}
]
]
, "body":
{ "type": "RESULT"
, "artifacts":
{ "type": "map_union"
, "$1":
[ {"type": "var", "name": "summary"}
, { "type": "singleton_map"
, "key": "work"
, "value":
{"type": "TREE", "$1": {"type": "var", "name": "summary input"}}
}
]
}
}
}
}
}
|