@daml-tools/daml-lint 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -126,6 +126,8 @@ Choose an output format:
|
|
|
126
126
|
daml-lint ./daml/ --format sarif # SARIF JSON (GitHub / IDE integration)
|
|
127
127
|
daml-lint ./daml/ --format markdown # Human-readable (default)
|
|
128
128
|
daml-lint ./daml/ --format json # Machine-readable JSON
|
|
129
|
+
daml-lint ./daml/ --rule missing-ensure-decimal # run one built-in rule
|
|
130
|
+
daml-lint ./daml/ --group recommended # run a rule group
|
|
129
131
|
```
|
|
130
132
|
|
|
131
133
|
Write results to a file:
|
|
@@ -143,19 +145,22 @@ Define your own detectors as AST rule scripts and pass them with `--rules`
|
|
|
143
145
|
daml-lint ./daml/ --rules my-rule.js --rules another-rule.js
|
|
144
146
|
```
|
|
145
147
|
|
|
146
|
-
Installed plugin packages can also be enabled from
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
148
|
+
Installed plugin packages can also be enabled from `./daml.yaml`:
|
|
149
|
+
|
|
150
|
+
```yaml
|
|
151
|
+
daml-tools:
|
|
152
|
+
lint:
|
|
153
|
+
plugins: [template]
|
|
154
|
+
plugin-paths: [./plugins]
|
|
155
|
+
rules:
|
|
156
|
+
missing-ensure-decimal: off
|
|
157
|
+
template/template-requires-ensure:
|
|
158
|
+
- warning
|
|
159
|
+
- allowEmptyEnsure: false
|
|
155
160
|
```
|
|
156
161
|
|
|
157
162
|
`template` resolves to `daml-lint-plugin-template` in `node_modules`; use
|
|
158
|
-
`
|
|
163
|
+
`plugin-paths` for local package roots during development. Rule options from the
|
|
159
164
|
array form are exposed to the rule as global `CONFIG`.
|
|
160
165
|
|
|
161
166
|
A rule is TypeScript/JavaScript (executed by an embedded QuickJS engine):
|
|
@@ -264,7 +269,8 @@ Each rule's script is evaluated once and its visitors are then called for
|
|
|
264
269
|
every module — visitors should be stateless; don't accumulate findings in
|
|
265
270
|
top-level mutable state across files.
|
|
266
271
|
|
|
267
|
-
`SEVERITY` is one of `critical`, `high`, `medium`, `low`, `info`.
|
|
272
|
+
`SEVERITY` is one of `critical`, `high`, `medium`, `low`, `info`. Config can
|
|
273
|
+
also use `error` (high) and `warning` (medium). Custom rules
|
|
268
274
|
run alongside the built-in detectors, appear in all output formats, and count
|
|
269
275
|
toward `--fail-on`. Direct `--rules` names must not collide with built-in
|
|
270
276
|
detector names or each other. Installed plugin rules are reported under their
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daml-tools/daml-lint",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Static analysis scanner for Daml smart contracts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"daml",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"node": ">=18"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"@daml-tools/daml-lint-darwin-arm64": "0.9.
|
|
27
|
-
"@daml-tools/daml-lint-linux-arm64": "0.9.
|
|
28
|
-
"@daml-tools/daml-lint-linux-x64": "0.9.
|
|
29
|
-
"@daml-tools/daml-lint-win32-x64": "0.9.
|
|
26
|
+
"@daml-tools/daml-lint-darwin-arm64": "0.9.2",
|
|
27
|
+
"@daml-tools/daml-lint-linux-arm64": "0.9.2",
|
|
28
|
+
"@daml-tools/daml-lint-linux-x64": "0.9.2",
|
|
29
|
+
"@daml-tools/daml-lint-win32-x64": "0.9.2"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|