bend-lint 0.2.2 → 0.3.1

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 CHANGED
@@ -48,10 +48,12 @@ bunx bend-lint [<file or glob>...] [--fix | --fix-dangerously] [--show-suppresse
48
48
  - With `--overlays`, the checker and the rules read each overlay in place of its file, also when a
49
49
  file imports it, and the file need not be on disk; name such a file to lint it. An editor gives
50
50
  its unsaved buffers so. It does not go with `--fix-dangerously`, which writes files on disk.
51
- - bend-lint builds your rules on its first run (about 40 s), and keeps the build until a rule or
52
- Bend changes. `bunx bend-lint prepare` builds them, and lints nothing: an editor runs it at start.
53
- If each rule you turn on is one of bend-lint's own, from `bend-lint-rules`, the build holds all of
54
- them, so you can turn them on and off without a new build.
51
+ - bend-lint builds your rules natively (about 40 s with clang), and keeps the build until a rule or
52
+ Bend changes. Until a native build is there, a run builds them to JavaScript (about 1 s), and
53
+ clang builds them in the background, for the runs after it: both find the same.
54
+ `bunx bend-lint prepare` waits for the native build, and lints nothing: an editor runs it at
55
+ start. If each rule you turn on is one of bend-lint's own, from `bend-lint-rules`, the build holds
56
+ all of them, so you can turn them on and off without a new build.
55
57
  - A fix that touches an earlier fix's edits waits for the next run.
56
58
  - bend-lint runs at low priority: a long run slows down, not your computer.
57
59
  - bend-lint does not report Bend's own errors: `bend <file> --check-only` does. If Bend's check of a
@@ -69,7 +71,8 @@ bunx bend-lint [<file or glob>...] [--fix | --fix-dangerously] [--show-suppresse
69
71
  ## Config
70
72
 
71
73
  `bend-lint.json` is the only place that picks the rules: a rule runs only if `rules` names it.
72
- bend-lint reads the nearest `bend-lint.json` above the folder it runs in.
74
+ bend-lint reads the nearest `bend-lint.json` up from the first file or folder it names (or, if it
75
+ names none, from the folder it runs in), and the nearest `bend-lint-rules/` up from that.
73
76
 
74
77
  ```json
75
78
  {
@@ -97,8 +100,8 @@ bend-lint reads the nearest `bend-lint.json` above the folder it runs in.
97
100
 
98
101
  bend-lint's own rules are on BendHub, as the package `bend-lint-rules` at bend-lint's version, with
99
102
  `.0` added. Name it in `packages`, then turn a rule on by its id, like
100
- `bend-lint-rules/layout/case`. Each file's header in [bend-lint-rules/](bend-lint-rules/) says what
101
- the rule reports, what its fix does, and its options.
103
+ `bend-lint-rules/layout/case`. Each file's header in [src/bend-lint-rules/](src/bend-lint-rules/)
104
+ says what the rule reports, what its fix does, and its options.
102
105
 
103
106
  ## Suppress findings
104
107
 
@@ -123,12 +126,13 @@ Form: `# bend-lint: <disable|expect>-<scope> <rule>[@severity] -- <reason>`.
123
126
 
124
127
  ## Write a rule
125
128
 
126
- A rule is a file in `bend-lint-rules/`. It imports bend-lint's rule API from BendHub,
127
- [lint.bend](src/linter/lint.bend), whose comments are the API, and defines `rule()`:
129
+ A rule is a file in `bend-lint-rules/`. It imports bend-lint's rule API from BendHub, whose
130
+ [spec.bend](src/linter/api/spec.bend) says what a rule sees, and defines `rule()`:
128
131
 
129
132
  ```
130
133
  import Base
131
- import bend-lint-api@0.2.2.0/linter/lint.bend as Lint
134
+ import bend-lint-api@0.3.1.0/linter/api/impl.bend as LintImpl
135
+ import bend-lint-api@0.3.1.0/linter/api/spec.bend as Lint
132
136
 
133
137
  def rule() -> Lint.Rule:
134
138
  ...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bend-lint",
3
- "version": "0.2.2",
3
+ "version": "0.3.1",
4
4
  "description": "Diagnostics for Bend 2 from rules outside the language: source text, and the checker's types",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "bun": "1.4.4"
16
16
  },
17
17
  "bendRelease": "bendlang/bend/v2.0.39",
18
- "bendWindows": "MattCozendey/bend/61750a3ae7d8a9acdd80ef40254cc30649d9d2ac",
18
+ "bendWindows": "MattCozendey/bend/e6ebd86626aa7ac850bc634b8d4ee2aad997c6d5",
19
19
  "scripts": {
20
20
  "postinstall": "bun ./src/linter/seam.ts postinstall"
21
21
  }