@diffpal/lintpal-darwin-arm64 0.5.4 → 0.6.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 +94 -41
- package/bin/lintpal +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# LintPal
|
|
2
2
|
|
|
3
|
+
<img src="docs/assets/lintpal-thumbnail.png" alt="DiffPal family mascot sticker with a white outline" width="120">
|
|
4
|
+
|
|
3
5
|
[](https://github.com/diffpal/lintpal/actions/workflows/ci.yml)
|
|
4
6
|
[](https://github.com/diffpal/lintpal/actions/workflows/lintpal-dev-review.yml)
|
|
5
7
|
[](https://www.npmjs.com/package/lintpal)
|
|
6
8
|
[](LICENSE)
|
|
7
9
|
|
|
8
|
-
**Turn
|
|
10
|
+
**Turn your engineering rules into pull-request checks.**
|
|
11
|
+
|
|
12
|
+
LintPal is a Go CLI that checks Git changes against your team's Markdown rules.
|
|
13
|
+
Your selected AI provider evaluates the rules; LintPal reports findings on
|
|
14
|
+
changed lines and applies a deterministic severity gate. Run it locally or
|
|
15
|
+
publish reviews directly to GitHub.
|
|
9
16
|
|
|
10
|
-
LintPal
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
specific requirements your team wants enforced on every change.
|
|
17
|
+
LintPal is part of the [DiffPal family](https://github.com/diffpal/diffpal).
|
|
18
|
+
It checks explicit repository rules; [DiffPal](https://diffpal.github.io/)
|
|
19
|
+
provides broader AI pull-request review across GitHub, GitLab, and Azure DevOps.
|
|
14
20
|
|
|
21
|
+
[Website](https://lintpal.metalagman.dev) ·
|
|
15
22
|
[Quickstart](docs/guides/getting-started.md) ·
|
|
16
23
|
[Documentation](docs/index.md) ·
|
|
17
24
|
[Rule packs](https://github.com/diffpal/lintpal-rules) ·
|
|
@@ -23,38 +30,62 @@ gate can then fail the check.
|
|
|
23
30
|
|
|
24
31
|
## Features
|
|
25
32
|
|
|
33
|
+
- **Provider choice:** use TypeSafe/Jev, OpenRouter, OpenAI, or your own
|
|
34
|
+
compatible Decisions service with the same repository rules and CI workflow.
|
|
26
35
|
- **Freeform rules:** write one clear requirement per Markdown file, with
|
|
27
36
|
optional severity and decision-threshold policy in frontmatter.
|
|
28
37
|
- **Rule packs:** import a local directory or a versioned GitHub catalog, then
|
|
29
38
|
review and commit the rules with your code.
|
|
30
39
|
- **Gating:** choose which finding severities block CI while retaining the
|
|
31
40
|
complete findings artifact after each successful evaluation.
|
|
32
|
-
- **Platform feedback:** publish a
|
|
41
|
+
- **Platform feedback:** publish a GitHub review summary and
|
|
33
42
|
inline comments, or consume the same findings as JSON or Markdown in CI.
|
|
34
43
|
|
|
44
|
+
## Supported Providers
|
|
45
|
+
|
|
46
|
+
Choose the provider that fits your account and deployment. Your Markdown rules,
|
|
47
|
+
findings, and severity gate work the same way across providers.
|
|
48
|
+
|
|
49
|
+
| Provider | Choose it for | CLI option | Credential |
|
|
50
|
+
| --- | --- | --- | --- |
|
|
51
|
+
| [**TypeSafe / Jev**](docs/guides/configuration.md#typesafe--jev) | Direct access to Jev; the default setup | `--provider jev` | `TYPESAFE_API_KEY` |
|
|
52
|
+
| [**OpenRouter**](docs/guides/configuration.md#openrouter) | Decisions through your OpenRouter account | `--provider openrouter` | `OPENROUTER_API_KEY` |
|
|
53
|
+
| [**OpenAI**](docs/guides/configuration.md#openai) | A preset for compatible OpenAI Decisions | `--provider openai --model <model-id>` | `OPENAI_API_KEY` |
|
|
54
|
+
| [**Custom**](docs/guides/configuration.md#custom-compatible-service) | Your own compatible service, including a local endpoint | `--provider custom --base-url <url> --api-path <path>` | `LINTPAL_TOKEN` or your chosen token variable |
|
|
55
|
+
|
|
56
|
+
All four provider options are included in
|
|
57
|
+
[v0.6.0](https://github.com/diffpal/lintpal/releases/tag/v0.6.0).
|
|
58
|
+
The OpenAI preset assumes a compatible `/v1/decisions` API; live availability
|
|
59
|
+
has not been verified.
|
|
60
|
+
See [provider setup and commands](docs/guides/configuration.md#supported-providers)
|
|
61
|
+
for all four options. The quickstart below uses TypeSafe/Jev.
|
|
62
|
+
|
|
35
63
|
## How It Works
|
|
36
64
|
|
|
37
65
|
| Stage | What LintPal does |
|
|
38
66
|
| --- | --- |
|
|
39
67
|
| Rules | Loads the repository's `.lintpal/rules/**/*.md` requirements |
|
|
40
|
-
| Diff | Reads changed lines
|
|
41
|
-
|
|
|
42
|
-
| Findings | Writes
|
|
43
|
-
| Feedback |
|
|
68
|
+
| Diff | Reads changed lines from the unique merge base through head, or from `HEAD` to the working tree with `--uncommitted` |
|
|
69
|
+
| Evaluation | Evaluates each applicable rule through the selected AI provider |
|
|
70
|
+
| Findings | Writes findings tied to changed lines as JSON or Markdown |
|
|
71
|
+
| Feedback (optional) | `feedback github` publishes GitHub comments; `--gate` applies the stored severity gate after publication |
|
|
44
72
|
|
|
45
|
-
|
|
46
|
-
|
|
73
|
+
Your repository defines the rules. Review and update them alongside the code
|
|
74
|
+
as your team's requirements change.
|
|
47
75
|
|
|
48
76
|
## Minimal GitHub Quickstart
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
Use Git and Node.js 16 or newer. npm packages provide native binaries for
|
|
79
|
+
Linux and macOS (x64 and arm64), and Windows (x64).
|
|
80
|
+
Install the CLI globally and add a versioned rule pack in your repository:
|
|
51
81
|
|
|
52
82
|
```bash
|
|
53
|
-
npm install
|
|
54
|
-
|
|
55
|
-
|
|
83
|
+
npm install -g lintpal
|
|
84
|
+
lintpal rule import github:diffpal/lintpal-rules//general@v1.1.0 --prefix general
|
|
85
|
+
lintpal rule validate
|
|
56
86
|
```
|
|
57
87
|
|
|
88
|
+
Review and commit `.lintpal/rules/` so the workflow can load the rules.
|
|
58
89
|
The selected remote provider receives bounded source context and rule text.
|
|
59
90
|
Check whether that transfer is permitted for your repository before adding
|
|
60
91
|
`TYPESAFE_API_KEY` as an Actions secret; see [privacy](docs/architecture/privacy.md).
|
|
@@ -81,15 +112,19 @@ jobs:
|
|
|
81
112
|
- uses: actions/setup-node@v6
|
|
82
113
|
with:
|
|
83
114
|
node-version: 24
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
115
|
+
- run: npm install -g lintpal
|
|
116
|
+
- name: Lint pull request
|
|
117
|
+
run: |
|
|
118
|
+
mkdir -p .artifacts/lintpal
|
|
119
|
+
lintpal lint --no-env-file --provider jev \
|
|
120
|
+
--base ${{ github.event.pull_request.base.sha }} \
|
|
121
|
+
--head ${{ github.event.pull_request.head.sha }} \
|
|
122
|
+
--block-on high --format json --out .artifacts/lintpal/findings.json
|
|
91
123
|
env:
|
|
92
124
|
TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
|
|
125
|
+
- name: Publish review and apply gate
|
|
126
|
+
run: lintpal feedback github --in .artifacts/lintpal/findings.json --gate
|
|
127
|
+
env:
|
|
93
128
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
94
129
|
- uses: actions/upload-artifact@v4
|
|
95
130
|
if: always()
|
|
@@ -101,11 +136,15 @@ jobs:
|
|
|
101
136
|
|
|
102
137
|
Open a same-repository pull request. LintPal publishes a review with
|
|
103
138
|
`No blocking findings`, `1 blocking finding`, or `N blocking findings`, plus
|
|
104
|
-
|
|
105
|
-
|
|
139
|
+
inline comments for eligible new or changed findings. Unchanged comments are
|
|
140
|
+
deduplicated on later runs. The gate runs after publication; the workflow
|
|
141
|
+
keeps `.artifacts/lintpal/findings.json`
|
|
142
|
+
even when a blocking finding fails the job. Draft and fork pull requests are
|
|
143
|
+
skipped. GitHub supplies the pull-request context to the feedback command.
|
|
106
144
|
|
|
107
|
-
See the [
|
|
108
|
-
|
|
145
|
+
See the [CLI reference](docs/reference/cli.md) for provider selection,
|
|
146
|
+
feedback commands, and exit codes. The [LintPal Action](https://github.com/diffpal/lintpal-action)
|
|
147
|
+
is also available for workflows that prefer an Action wrapper.
|
|
109
148
|
|
|
110
149
|
## Write Rules in Markdown
|
|
111
150
|
|
|
@@ -122,15 +161,20 @@ title: Unchecked error
|
|
|
122
161
|
Handle errors returned by calls when failure changes the result or behavior.
|
|
123
162
|
```
|
|
124
163
|
|
|
164
|
+
Save this rule as `.lintpal/rules/go/unchecked-error.md`. When the provider assigns
|
|
165
|
+
a violation probability of at least `0.97`, a finding identifies the changed file and line,
|
|
166
|
+
the `high` severity, and rule ID `go/unchecked-error.md`. Its message is
|
|
167
|
+
`Changed code may violate go/unchecked-error.md.` The default severity gate
|
|
168
|
+
blocks on high or critical findings.
|
|
169
|
+
|
|
125
170
|
Rules are ordinary project files: review them, version them, and change them
|
|
126
|
-
through the same pull-request process as code.
|
|
127
|
-
built-in mandates.
|
|
171
|
+
through the same pull-request process as code.
|
|
128
172
|
|
|
129
173
|
```bash
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
174
|
+
lintpal rule list
|
|
175
|
+
lintpal rule view general/authorization.md
|
|
176
|
+
lintpal rule validate
|
|
177
|
+
lintpal rule import github:diffpal/lintpal-rules//go@v1.1.0 --prefix go
|
|
134
178
|
```
|
|
135
179
|
|
|
136
180
|
Read [rule authoring](docs/rules/authoring.md) for the complete format and
|
|
@@ -138,26 +182,33 @@ Read [rule authoring](docs/rules/authoring.md) for the complete format and
|
|
|
138
182
|
|
|
139
183
|
## Run Locally
|
|
140
184
|
|
|
141
|
-
|
|
185
|
+
Install the CLI and add rules using the [getting started guide](docs/guides/getting-started.md).
|
|
186
|
+
Then run from your Git repository to check working-tree changes before committing
|
|
187
|
+
or compare two committed revisions:
|
|
142
188
|
|
|
143
189
|
```bash
|
|
144
190
|
export TYPESAFE_API_KEY='your-provider-key'
|
|
145
|
-
|
|
191
|
+
lintpal doctor
|
|
146
192
|
|
|
147
193
|
# Lint uncommitted working-tree changes (staged, unstaged, and untracked regular files)
|
|
148
|
-
|
|
194
|
+
lintpal lint --uncommitted
|
|
149
195
|
|
|
150
196
|
# Or lint committed revisions
|
|
151
|
-
|
|
197
|
+
lintpal lint --base origin/main --head HEAD
|
|
152
198
|
```
|
|
153
199
|
|
|
200
|
+
Committed comparisons start at the unique merge base of base and head; changes
|
|
201
|
+
found only on the base branch are excluded. See the [CLI reference](docs/reference/cli.md)
|
|
202
|
+
for report revision fields and uncommitted behavior.
|
|
203
|
+
|
|
154
204
|
Markdown findings go to stdout. Use `--out` to retain the complete JSON
|
|
155
205
|
artifact, or `--format json` for JSON on stdout. The default gate returns exit
|
|
156
206
|
code `10` when a high or critical finding blocks the run.
|
|
157
207
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
208
|
+
Choose TypeSafe/Jev, OpenRouter, OpenAI, or a custom compatible endpoint
|
|
209
|
+
from [Supported Providers](#supported-providers). Configure credentials through
|
|
210
|
+
environment variables or an uncommitted `.env` file. The selected remote
|
|
211
|
+
provider receives bounded source context and rule text.
|
|
161
212
|
See [configuration](docs/guides/configuration.md) and [privacy](docs/architecture/privacy.md).
|
|
162
213
|
|
|
163
214
|
## Documentation by Goal
|
|
@@ -171,7 +222,9 @@ See [configuration](docs/guides/configuration.md) and [privacy](docs/architectur
|
|
|
171
222
|
| Understand findings and gates | [Report reference](docs/reference/report.md) |
|
|
172
223
|
| Automate the CLI | [CLI reference](docs/reference/cli.md) |
|
|
173
224
|
| Review security and data flow | [Privacy](docs/architecture/privacy.md) and [architecture](docs/architecture/overview.md) |
|
|
174
|
-
|
|
|
225
|
+
| Ask a setup question | [GitHub Discussions Q&A](https://github.com/diffpal/lintpal/discussions/categories/q-a) |
|
|
226
|
+
| Suggest a workflow improvement | [GitHub Discussions Ideas](https://github.com/diffpal/lintpal/discussions/categories/ideas) |
|
|
227
|
+
| Report a bug or incorrect finding | [GitHub Issues](https://github.com/diffpal/lintpal/issues/new) |
|
|
175
228
|
| Contribute to LintPal | [Contributing](CONTRIBUTING.md) |
|
|
176
229
|
|
|
177
230
|
## License
|
package/bin/lintpal
CHANGED
|
Binary file
|
package/package.json
CHANGED