@diffpal/lintpal-darwin-arm64 0.2.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 +55 -60
- package/bin/lintpal +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,77 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LintPal
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
commit the revision you want to inspect before running it.
|
|
3
|
+
[](https://github.com/diffpal/lintpal/actions/workflows/test.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/lintpal)
|
|
5
|
+
[](LICENSE)
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
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.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
npm install -g lintpal@0.2.0
|
|
13
|
-
# or
|
|
14
|
-
npm install -g @diffpal/lintpal@0.2.0
|
|
15
|
-
lintpal version
|
|
16
|
-
```
|
|
12
|
+
## Start
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
the local build below works now.
|
|
14
|
+
Install LintPal in your project, or use `npx lintpal` directly:
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
```bash
|
|
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
|
|
24
|
+
```
|
|
24
25
|
|
|
25
|
-
|
|
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).
|
|
26
31
|
|
|
27
|
-
|
|
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.
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
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.
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
System One server, so the last command needs no provider secret or network
|
|
38
|
-
account. A plain local build reports version `dev`. Omnidist staging can embed
|
|
39
|
-
an explicit version; see [distribution staging](docs/distribution.md).
|
|
44
|
+
## Work with rules
|
|
40
45
|
|
|
41
|
-
|
|
42
|
-
|
|
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.
|
|
43
50
|
|
|
44
51
|
```bash
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
--format json --fail-on high --out .artifacts/lintpal/report.json
|
|
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
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
context and rule questions to the selected provider. See the [CLI guide](docs/cli.md)
|
|
58
|
-
for flags, environment settings, output formats, and exit codes. Exit code `10`
|
|
59
|
-
means the complete report was written and a finding met `--fail-on`; it can be
|
|
60
|
-
used as a CI gate.
|
|
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.
|
|
61
63
|
|
|
62
|
-
##
|
|
64
|
+
## Learn more
|
|
63
65
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
binary in the job, fetch the base revision, provide the selected credential as
|
|
68
|
-
a CI secret, then run the `lint` command above with `--base` and `--head` set to
|
|
69
|
-
commits available in that checkout. Handle exit code `10` as a lint failure;
|
|
70
|
-
other nonzero codes indicate setup, provider, or export failure. Never print
|
|
71
|
-
the credential or enable shell tracing around it.
|
|
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)
|
|
72
69
|
|
|
73
|
-
The
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[evaluation guide](docs/evaluation.md) describes the offline corpus and an
|
|
77
|
-
optional, explicit live procedure.
|
|
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
|