bend-lint 0.1.0 → 0.1.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 +6 -6
- package/package.json +2 -2
- package/src/files/main.bend +2 -2
- package/src/json/main.bend +2 -2
- package/src/linter/cli.bend +6 -6
- package/src/linter/directives.bend +4 -4
- package/src/linter/fixes.bend +4 -4
- package/src/text/main.bend +3 -3
package/README.md
CHANGED
|
@@ -65,18 +65,18 @@ bend-lint reads the nearest `bend-lint.json` above the folder it runs in.
|
|
|
65
65
|
"packages": { "jane-rules": "1.0.0.0" },
|
|
66
66
|
"rules": {
|
|
67
67
|
"format": { "tabWidth": 4, "severity": "hint" },
|
|
68
|
-
"style/
|
|
69
|
-
"style/
|
|
70
|
-
"jane-rules/
|
|
68
|
+
"style/no_foo": "error",
|
|
69
|
+
"style/no_bar": "off",
|
|
70
|
+
"jane-rules/no_baz": "warning"
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
- `rules`: each rule to run, by its id: its path in `bend-lint-rules/`, without `.bend`
|
|
76
|
-
(`bend-lint-rules/style/
|
|
76
|
+
(`bend-lint-rules/style/no_foo.bend` is `style/no_foo`). Give it `"off"`, a severity (`error`,
|
|
77
77
|
`warning`, `information`, `hint`), or an object of its options and a `"severity"`.
|
|
78
78
|
- `packages`: BendHub packages of rules, names to versions. A rule whose id starts with a package's
|
|
79
|
-
name, then `/`, is that package's file at the rest of the id: `jane-rules/
|
|
79
|
+
name, then `/`, is that package's file at the rest of the id: `jane-rules/no_baz` is `no_baz.bend`
|
|
80
80
|
in `jane-rules@1.0.0.0`.
|
|
81
81
|
- `entries`: your program's entry files, as paths from the folder of `bend-lint.json`. A rule that
|
|
82
82
|
reads the whole program ("this def is never used") then sees it, even when you lint one file.
|
|
@@ -115,7 +115,7 @@ A rule is a file in `bend-lint-rules/`. It imports bend-lint's rule API from Ben
|
|
|
115
115
|
|
|
116
116
|
```
|
|
117
117
|
import Base
|
|
118
|
-
import bend-lint-api@0.1.
|
|
118
|
+
import bend-lint-api@0.1.1.0/linter/lint.bend as Lint
|
|
119
119
|
|
|
120
120
|
def rule() -> Lint.Rule:
|
|
121
121
|
...
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bend-lint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.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
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bun": "1.4.3"
|
|
12
12
|
},
|
|
13
13
|
"bendRelease": "bendlang/bend/v2.0.37",
|
|
14
|
-
"bendWindows": "MattCozendey/bend/
|
|
14
|
+
"bendWindows": "MattCozendey/bend/8621b563d53ab015dad5af3b07e679643931d780",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"postinstall": "bun ./src/linter/seam.ts postinstall"
|
|
17
17
|
}
|
package/src/files/main.bend
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Base
|
|
2
|
-
import bend-lint-api@0.1.
|
|
3
|
-
import bend-lint-api@0.1.
|
|
2
|
+
import bend-lint-api@0.1.1.0/shared/lists.bend as Lists
|
|
3
|
+
import bend-lint-api@0.1.1.0/shared/strings.bend as Strings
|
|
4
4
|
|
|
5
5
|
# Types
|
|
6
6
|
# =====
|
package/src/json/main.bend
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Base
|
|
2
|
-
import bend-lint-api@0.1.
|
|
3
|
-
import bend-lint-api@0.1.
|
|
2
|
+
import bend-lint-api@0.1.1.0/shared/names.bend as Names
|
|
3
|
+
import bend-lint-api@0.1.1.0/shared/strings.bend as Strings
|
|
4
4
|
|
|
5
5
|
# Types
|
|
6
6
|
# =====
|
package/src/linter/cli.bend
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import Base
|
|
3
3
|
import ../files/main.bend as Files
|
|
4
4
|
import ../json/main.bend as Json
|
|
5
|
-
import bend-lint-api@0.1.
|
|
6
|
-
import bend-lint-api@0.1.
|
|
5
|
+
import bend-lint-api@0.1.1.0/shared/lists.bend as Lists
|
|
6
|
+
import bend-lint-api@0.1.1.0/shared/names.bend as Names
|
|
7
7
|
import ../text/main.bend as Text
|
|
8
8
|
import ./directives.bend as Directives
|
|
9
9
|
import ./fixes.bend as Fixes
|
|
10
|
-
import bend-lint-api@0.1.
|
|
10
|
+
import bend-lint-api@0.1.1.0/linter/lint.bend as Lint
|
|
11
11
|
|
|
12
12
|
# Config
|
|
13
13
|
# ======
|
|
@@ -67,7 +67,7 @@ def Parsed.value(value: Json.Json) -> Maybe<&2, Lint.Value>:
|
|
|
67
67
|
case Json.JFalse{}:
|
|
68
68
|
Some{Lint.Flag{False{}}}
|
|
69
69
|
case Json.JString{text}:
|
|
70
|
-
Some{Lint.
|
|
70
|
+
Some{Lint.Chars{text}}
|
|
71
71
|
case _:
|
|
72
72
|
None{}
|
|
73
73
|
|
|
@@ -1071,9 +1071,9 @@ def Spec.accepts(spec: Lint.Spec, value: Lint.Value) -> Bool:
|
|
|
1071
1071
|
U32.is_le(min, n) && U32.is_le(n, max)
|
|
1072
1072
|
case Lint.FlagOption{} Lint.Flag{on}:
|
|
1073
1073
|
True{}
|
|
1074
|
-
case Lint.TextOption{Nil{}} Lint.
|
|
1074
|
+
case Lint.TextOption{Nil{}} Lint.Chars{text}:
|
|
1075
1075
|
True{}
|
|
1076
|
-
case Lint.TextOption{choices} Lint.
|
|
1076
|
+
case Lint.TextOption{choices} Lint.Chars{text}:
|
|
1077
1077
|
List.contains(~String, ~String.eq, choices, text)
|
|
1078
1078
|
case _ _:
|
|
1079
1079
|
False{}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Base
|
|
2
|
-
import bend-lint-api@0.1.
|
|
3
|
-
import bend-lint-api@0.1.
|
|
4
|
-
import bend-lint-api@0.1.
|
|
2
|
+
import bend-lint-api@0.1.1.0/shared/lists.bend as Lists
|
|
3
|
+
import bend-lint-api@0.1.1.0/shared/names.bend as Names
|
|
4
|
+
import bend-lint-api@0.1.1.0/shared/strings.bend as Strings
|
|
5
5
|
import ../text/main.bend as Text
|
|
6
|
-
import bend-lint-api@0.1.
|
|
6
|
+
import bend-lint-api@0.1.1.0/linter/lint.bend as Lint
|
|
7
7
|
|
|
8
8
|
# Scanning
|
|
9
9
|
# ========
|
package/src/linter/fixes.bend
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# The fixes a run makes with `--fix-dangerously`: no fix is proven to keep the program until Bend's checker is Bend.
|
|
2
2
|
import Base
|
|
3
3
|
import ../files/main.bend as Files
|
|
4
|
-
import bend-lint-api@0.1.
|
|
5
|
-
import bend-lint-api@0.1.
|
|
6
|
-
import bend-lint-api@0.1.
|
|
4
|
+
import bend-lint-api@0.1.1.0/shared/lists.bend as Lists
|
|
5
|
+
import bend-lint-api@0.1.1.0/shared/names.bend as Names
|
|
6
|
+
import bend-lint-api@0.1.1.0/shared/strings.bend as Strings
|
|
7
7
|
import ../text/main.bend as Text
|
|
8
|
-
import bend-lint-api@0.1.
|
|
8
|
+
import bend-lint-api@0.1.1.0/linter/lint.bend as Lint
|
|
9
9
|
|
|
10
10
|
# Types
|
|
11
11
|
# =====
|
package/src/text/main.bend
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Edits to texts, and places in them: the edits to make, spans that must not touch, and the lines and columns of
|
|
2
2
|
# offsets.
|
|
3
3
|
import Base
|
|
4
|
-
import bend-lint-api@0.1.
|
|
5
|
-
import bend-lint-api@0.1.
|
|
6
|
-
import bend-lint-api@0.1.
|
|
4
|
+
import bend-lint-api@0.1.1.0/shared/lists.bend as Lists
|
|
5
|
+
import bend-lint-api@0.1.1.0/shared/names.bend as Names
|
|
6
|
+
import bend-lint-api@0.1.1.0/shared/strings.bend as Strings
|
|
7
7
|
|
|
8
8
|
# Edits
|
|
9
9
|
# =====
|