@daml-tools/daml-lint 0.9.1 → 0.9.3

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.
Files changed (2) hide show
  1. package/README.md +22 -11
  2. 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 `.daml-lint.json`:
147
-
148
- ```json
149
- {
150
- "plugins": ["template"],
151
- "rules": {
152
- "template/template-requires-ensure": ["medium", { "allowEmptyEnsure": false }]
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
- `pluginPaths` for local package roots during development. Rule options from the
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):
@@ -245,6 +250,11 @@ Removed v1/v2 compatibility fields and their structured replacements:
245
250
  | `stmt.Create.raw` | `template_name` + `argument` (`Expr`) | `argument` is the created payload. |
246
251
  | `stmt.Exercise.raw` | `cid` + `choice_name` + `argument` (`Expr`) | `argument` is the choice argument, if present. |
247
252
  | `choice.controllers` | `controller_exprs` (`Expr[]`) | Flatten list expressions in the rule if you want list-literal party semantics. |
253
+ | `choice.authorities` | `authority_exprs` (`Expr[]`) | Source-level `authority` metadata clauses on choices. |
254
+ | `interface_instance.view` | `view_expr` (`Expr \| null`) | Source-level `view = ...` on interface instances, distinct from method names. |
255
+ | `case_alt.guards` | `branches[].guards` (`CaseGuard[]`) | Boolean and pattern guards on case alternative branches. |
256
+ | `case_alt.where` | `where_bindings` (`LetBinding[]`) | Alternative-local `where` helper bindings on case alternatives. |
257
+ | `import.package` | `package_label` (`string \| null`) | Decoded package string from `import "pkg" Module`; not an LF `PackageId`. |
248
258
  | `template.signatories`, `template.observers` | `signatory_exprs`, `observer_exprs` (`Expr[]`) | Structured party expressions only. |
249
259
 
250
260
  `stmt.Other.raw` and the `Unknown` expression's `raw` are deliberate raw-source
@@ -264,7 +274,8 @@ Each rule's script is evaluated once and its visitors are then called for
264
274
  every module — visitors should be stateless; don't accumulate findings in
265
275
  top-level mutable state across files.
266
276
 
267
- `SEVERITY` is one of `critical`, `high`, `medium`, `low`, `info`. Custom rules
277
+ `SEVERITY` is one of `critical`, `high`, `medium`, `low`, `info`. Config can
278
+ also use `error` (high) and `warning` (medium). Custom rules
268
279
  run alongside the built-in detectors, appear in all output formats, and count
269
280
  toward `--fail-on`. Direct `--rules` names must not collide with built-in
270
281
  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.1",
3
+ "version": "0.9.3",
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.1",
27
- "@daml-tools/daml-lint-linux-arm64": "0.9.1",
28
- "@daml-tools/daml-lint-linux-x64": "0.9.1",
29
- "@daml-tools/daml-lint-win32-x64": "0.9.1"
26
+ "@daml-tools/daml-lint-darwin-arm64": "0.9.3",
27
+ "@daml-tools/daml-lint-linux-arm64": "0.9.3",
28
+ "@daml-tools/daml-lint-linux-x64": "0.9.3",
29
+ "@daml-tools/daml-lint-win32-x64": "0.9.3"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"