@diffpal/lintpal-darwin-arm64 0.3.0 → 0.4.0
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 +50 -113
- package/bin/lintpal +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,135 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LintPal
|
|
2
2
|
|
|
3
3
|
[](https://github.com/diffpal/lintpal/actions/workflows/test.yml)
|
|
4
|
-
[](https://github.com/diffpal/lintpal/actions/workflows/lint.yml)
|
|
5
|
-
[](https://github.com/diffpal/lintpal/actions/workflows/security.yml)
|
|
6
|
-
[](https://github.com/diffpal/lintpal/releases/latest)
|
|
7
4
|
[](https://www.npmjs.com/package/lintpal)
|
|
8
5
|
[](LICENSE)
|
|
9
6
|
|
|
10
|
-
**
|
|
11
|
-
|
|
12
|
-
reports findings
|
|
13
|
-
|
|
14
|
-
same committed inputs.
|
|
7
|
+
**Lint committed changes against the rules your team writes.** Put requirements
|
|
8
|
+
in Markdown files beside your code. LintPal checks changed lines in two Git
|
|
9
|
+
revisions, reports findings with file and line anchors, and can fail CI when a
|
|
10
|
+
finding reaches your severity gate.
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
unsaved and uncommitted working-tree changes are outside the comparison.
|
|
12
|
+
## Start
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Install the current public release through npm:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm install -g lintpal
|
|
25
|
-
lintpal version
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
To use features from this source revision before they reach npm, build it with
|
|
29
|
-
Go 1.26.6 or newer:
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
go build -o ./lintpal ./cmd/lintpal
|
|
33
|
-
./lintpal version
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Choose a provider credential. For the default `jev` provider, set
|
|
37
|
-
`TYPESAFE_API_KEY` in your environment or copy [`.env.example`](.env.example)
|
|
38
|
-
to `.env` and fill in the key. The local `doctor` check does not contact the
|
|
39
|
-
provider:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
./lintpal doctor --provider jev
|
|
43
|
-
mkdir -p .artifacts/lintpal
|
|
44
|
-
./lintpal lint --base HEAD~1 --head HEAD --provider jev \
|
|
45
|
-
--format json --fail-on high --out .artifacts/lintpal/report.json
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Both revisions must be available commits in the repository where you run
|
|
49
|
-
lintpal. Use an absolute path to the built binary when reviewing another
|
|
50
|
-
repository. The report is printed to stdout and written to the artifact path;
|
|
51
|
-
exit code `10` means a finding met the gate **after** the complete report was
|
|
52
|
-
written. See [getting started](docs/getting-started.md) for shallow clones,
|
|
53
|
-
other providers, and error handling. See [distribution](docs/distribution.md)
|
|
54
|
-
for the published package layout and release status.
|
|
55
|
-
|
|
56
|
-
## Make the review yours
|
|
57
|
-
|
|
58
|
-
A rule pairs a question with a decision threshold and fixed diagnostic text.
|
|
59
|
-
For example, a `noul` rule can ask whether changed Go code drops a meaningful
|
|
60
|
-
error:
|
|
61
|
-
|
|
62
|
-
```yaml
|
|
63
|
-
schema: lintpal.rules.v1
|
|
64
|
-
rules:
|
|
65
|
-
- id: go.unchecked-error
|
|
66
|
-
type: noul
|
|
67
|
-
instructions: Does the changed Go code discard an error whose failure should be handled?
|
|
68
|
-
threshold: 0.95
|
|
69
|
-
severity: high
|
|
70
|
-
title: Possible unchecked error
|
|
71
|
-
message: Review whether this error needs handling.
|
|
72
|
-
paths: ['*.go']
|
|
73
|
-
sides: [RIGHT]
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
The checked-in [Go review pack](examples/rules/go-review/rules.yaml) also shows
|
|
77
|
-
`choice` and `score` rules. The
|
|
78
|
-
[documentation review pack](examples/rules/docs-review/rules.yaml) shows a
|
|
79
|
-
focused Markdown rule. These are authoring examples, not claims of measured
|
|
80
|
-
model accuracy. See [rule authoring](docs/rule-authoring.md) to write and
|
|
81
|
-
calibrate rules.
|
|
82
|
-
|
|
83
|
-
Import a pack explicitly from a local directory, verify its lockfile, and
|
|
84
|
-
select it for a review:
|
|
14
|
+
Install LintPal in your project, or use `npx lintpal` directly:
|
|
85
15
|
|
|
86
16
|
```bash
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
17
|
+
npm install --save-dev lintpal
|
|
18
|
+
mkdir -p .lintpal/rules/go
|
|
19
|
+
cat > .lintpal/rules/go/errors.md <<'RULE'
|
|
20
|
+
Handle errors returned by calls when failure can change the result or behavior.
|
|
21
|
+
RULE
|
|
22
|
+
export TYPESAFE_API_KEY='your-provider-key'
|
|
23
|
+
npx lintpal lint --base origin/main --head HEAD
|
|
90
24
|
```
|
|
91
25
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
26
|
+
Both revisions must be committed and available locally. LintPal reads rules
|
|
27
|
+
from the Git worktree root `.lintpal/rules/`, even when run from a subdirectory.
|
|
28
|
+
There are no built-in mandates. A missing or invalid rule directory stops the
|
|
29
|
+
run before any provider request. The selected provider receives bounded
|
|
30
|
+
committed source context and rule text; see [privacy](docs/privacy.md).
|
|
96
31
|
|
|
97
|
-
|
|
32
|
+
The command prints Markdown findings. The default gate fails with exit code
|
|
33
|
+
`10` for a finding of **high** or **critical** severity, after writing the
|
|
34
|
+
complete output. Use `--out .artifacts/lintpal/findings.json` for a JSON
|
|
35
|
+
artifact, or `--format json` for JSON on stdout. See the [CLI reference](docs/cli.md)
|
|
36
|
+
for provider options, filters, and two-command CI feedback.
|
|
98
37
|
|
|
99
|
-
|
|
100
|
-
`
|
|
38
|
+
Stored findings can also be published to a GitHub pull request without another
|
|
39
|
+
model call. `lintpal feedback github` posts a deterministic blocking-status
|
|
40
|
+
result and inline rule findings; it does not generate a semantic code review or
|
|
41
|
+
change summary. See the [CLI reference](docs/cli.md#lintpal-cli) for flags and
|
|
42
|
+
the required pull-request permission.
|
|
101
43
|
|
|
102
|
-
|
|
103
|
-
task --list
|
|
104
|
-
task check
|
|
105
|
-
task self-review-smoke
|
|
106
|
-
```
|
|
44
|
+
## Work with rules
|
|
107
45
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
real provider, use explicit committed refs:
|
|
46
|
+
Each `.md` file is one mandate; its path beneath `.lintpal/rules/` is its ID.
|
|
47
|
+
Optional frontmatter sets `title`, `severity`, and `threshold`. Directory names
|
|
48
|
+
organize IDs; every rule applies to eligible changed lines on both sides of the
|
|
49
|
+
diff.
|
|
113
50
|
|
|
114
51
|
```bash
|
|
115
|
-
|
|
52
|
+
npx lintpal rule list
|
|
53
|
+
npx lintpal rule view go/errors.md
|
|
54
|
+
npx lintpal rule validate
|
|
55
|
+
npx lintpal rule import ./team-rules --prefix team
|
|
116
56
|
```
|
|
117
57
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
and
|
|
121
|
-
|
|
122
|
-
|
|
58
|
+
`rule import` copies validated Markdown into `.lintpal/rules/`, so the next lint
|
|
59
|
+
uses it automatically. Commit and review those files with your project. GitHub
|
|
60
|
+
imports can select a ref and subdirectory; [rule import](docs/rule-import.md)
|
|
61
|
+
explains the source syntax and collision handling. See [rule authoring](docs/rule-authoring.md)
|
|
62
|
+
for examples and per-run overrides.
|
|
123
63
|
|
|
124
|
-
|
|
64
|
+
## Learn more
|
|
125
65
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
| [Reports](docs/report.md) · [Privacy and limits](docs/privacy.md) | [Development tasks](docs/development.md) · [Self-review](docs/self-review.md) · [Evaluation](docs/evaluation.md) |
|
|
66
|
+
- [Getting started](docs/getting-started.md) and [configuration](docs/configuration.md)
|
|
67
|
+
- [Findings and gates](docs/report.md)
|
|
68
|
+
- [Contributing](CONTRIBUTING.md) and [development tasks](docs/development.md)
|
|
130
69
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
changes, apply fixes, or report measured model precision. lintpal is available
|
|
135
|
-
under the [MIT license](LICENSE).
|
|
70
|
+
The commands above describe this source revision. Check
|
|
71
|
+
[releases](https://github.com/diffpal/lintpal/releases) for the features in a
|
|
72
|
+
published npm version. LintPal is available under the [MIT license](LICENSE).
|
package/bin/lintpal
CHANGED
|
Binary file
|
package/package.json
CHANGED