@diffpal/lintpal-darwin-arm64 0.2.0 → 0.3.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 +114 -56
- package/bin/lintpal +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,77 +1,135 @@
|
|
|
1
1
|
# lintpal
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/lintpal)
|
|
8
|
+
[](LICENSE)
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
**Review committed code changes with questions you control.** lintpal compares
|
|
11
|
+
two Git revisions, asks a selected System One provider focused questions, and
|
|
12
|
+
reports findings on changed lines. Rules are declarative YAML, so a team can
|
|
13
|
+
keep review policy beside its code, pin imported rule packs, and revisit the
|
|
14
|
+
same committed inputs.
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
# or
|
|
14
|
-
npm install -g @diffpal/lintpal@0.2.0
|
|
15
|
-
lintpal version
|
|
16
|
-
```
|
|
16
|
+
lintpal is a CLI for review, not an auto-fixer. It reads committed Git objects;
|
|
17
|
+
unsaved and uncommitted working-tree changes are outside the comparison.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
the local build below works now.
|
|
19
|
+
## Start in a few commands
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
for existing installs. npm rejected the unscoped `jevlint` name, so that release
|
|
23
|
-
did not receive a GitHub release.
|
|
21
|
+
Install the current public release through npm:
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g lintpal
|
|
25
|
+
lintpal version
|
|
26
|
+
```
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
To use features from this source revision before they reach npm, build it with
|
|
29
|
+
Go 1.26.6 or newer:
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
32
|
go build -o ./lintpal ./cmd/lintpal
|
|
31
33
|
./lintpal version
|
|
32
|
-
./lintpal --help
|
|
33
|
-
go test ./cmd/lintpal -run TestProcessExitAndStreams -count=1
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
To lint a real comparison, run these commands **inside the repository being
|
|
42
|
-
reviewed** after both revisions are committed:
|
|
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:
|
|
43
40
|
|
|
44
41
|
```bash
|
|
45
|
-
export TYPESAFE_API_KEY='your-token'
|
|
46
42
|
./lintpal doctor --provider jev
|
|
47
43
|
mkdir -p .artifacts/lintpal
|
|
48
|
-
./lintpal lint --base
|
|
44
|
+
./lintpal lint --base HEAD~1 --head HEAD --provider jev \
|
|
49
45
|
--format json --fail-on high --out .artifacts/lintpal/report.json
|
|
50
46
|
```
|
|
51
47
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
for
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
the
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[
|
|
77
|
-
|
|
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:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
./lintpal pack import go-review ./examples/rules/go-review
|
|
88
|
+
./lintpal pack verify go-review
|
|
89
|
+
./lintpal lint --base HEAD~1 --head HEAD --rules @go-review
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
GitHub imports require an explicit ref. lintpal resolves it to a commit,
|
|
93
|
+
stores a local copy, and records the exact content hash in
|
|
94
|
+
`.lintpal/packs.lock.json`. Normal lint runs use the local copy offline; see
|
|
95
|
+
[rule packs](docs/rule-packs.md) for source syntax and updates.
|
|
96
|
+
|
|
97
|
+
## Use it in development
|
|
98
|
+
|
|
99
|
+
[Task](https://taskfile.dev/docs/installation) runs routine checks from
|
|
100
|
+
`Taskfile.yml`:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
task --list
|
|
104
|
+
task check
|
|
105
|
+
task self-review-smoke
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`task check` builds, tests, vets, checks formatting, evaluates the frozen
|
|
109
|
+
offline corpus, and verifies docs and installed packs without a provider key.
|
|
110
|
+
The [test workflow](.github/workflows/test.yml) keeps these checks credential-free
|
|
111
|
+
on Linux, macOS, and Windows as appropriate. To review lintpal itself with a
|
|
112
|
+
real provider, use explicit committed refs:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
BASE=origin/main HEAD=HEAD task self-review
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
This opt-in command writes `.artifacts/lintpal/self-review.json`. Read the
|
|
119
|
+
[self-review guide](docs/self-review.md) for provider setup, rule selection,
|
|
120
|
+
and gate behavior.
|
|
121
|
+
|
|
122
|
+
## Documentation
|
|
123
|
+
|
|
124
|
+
Start at the [documentation index](docs/index.md), or jump to:
|
|
125
|
+
|
|
126
|
+
| Use lintpal | Extend and maintain it |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| [Getting started](docs/getting-started.md) · [Configuration](docs/configuration.md) · [CLI](docs/cli.md) | [Rule authoring](docs/rule-authoring.md) · [Rule packs](docs/rule-packs.md) |
|
|
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) |
|
|
130
|
+
|
|
131
|
+
When a remote provider is selected, lintpal sends bounded committed source
|
|
132
|
+
context and rule questions to it. Review the [privacy guide](docs/privacy.md)
|
|
133
|
+
before running a live review. The current CLI does not inspect uncommitted
|
|
134
|
+
changes, apply fixes, or report measured model precision. lintpal is available
|
|
135
|
+
under the [MIT license](LICENSE).
|
package/bin/lintpal
CHANGED
|
Binary file
|