@diffpal/lintpal-darwin-arm64 0.5.4 → 0.6.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 +65 -26
- package/bin/lintpal +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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)
|
|
@@ -12,6 +14,11 @@ repository. It produces findings on changed lines, applies a deterministic
|
|
|
12
14
|
severity gate, and can publish the result directly to GitHub. Use it for
|
|
13
15
|
specific requirements your team wants enforced on every change.
|
|
14
16
|
|
|
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.
|
|
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,6 +30,8 @@ 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
|
|
@@ -32,14 +41,32 @@ gate can then fail the check.
|
|
|
32
41
|
- **Platform feedback:** publish a deterministic 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
|
+
The OpenAI preset assumes a compatible `/v1/decisions` API; live availability
|
|
57
|
+
has not been verified. These options describe this source revision; check
|
|
58
|
+
[releases](https://github.com/diffpal/lintpal/releases) for published package support.
|
|
59
|
+
See [provider setup and commands](docs/guides/configuration.md#supported-providers)
|
|
60
|
+
for all four options. The quickstart below uses TypeSafe/Jev.
|
|
61
|
+
|
|
35
62
|
## How It Works
|
|
36
63
|
|
|
37
64
|
| Stage | What LintPal does |
|
|
38
65
|
| --- | --- |
|
|
39
66
|
| Rules | Loads the repository's `.lintpal/rules/**/*.md` requirements |
|
|
40
|
-
| Diff | Reads changed lines
|
|
67
|
+
| Diff | Reads changed lines from the unique merge base through head, or from `HEAD` to the working tree with `--uncommitted` |
|
|
41
68
|
| Decisions | Evaluates each applicable rule through the configured provider |
|
|
42
|
-
| Findings | Writes line-anchored findings in
|
|
69
|
+
| Findings | Writes line-anchored findings in LintPal's findings v5 format |
|
|
43
70
|
| Feedback | Publishes inline GitHub comments and applies the configured gate |
|
|
44
71
|
|
|
45
72
|
LintPal is a focused policy checker. It does not generate a narrative code
|
|
@@ -47,14 +74,15 @@ review or invent new review criteria during a run.
|
|
|
47
74
|
|
|
48
75
|
## Minimal GitHub Quickstart
|
|
49
76
|
|
|
50
|
-
Install
|
|
77
|
+
Install the CLI globally and add a versioned rule pack in your repository:
|
|
51
78
|
|
|
52
79
|
```bash
|
|
53
|
-
npm install
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
npm install -g lintpal
|
|
81
|
+
lintpal rule import github:diffpal/lintpal-rules//general@v1.1.0
|
|
82
|
+
lintpal rule validate
|
|
56
83
|
```
|
|
57
84
|
|
|
85
|
+
Review and commit `.lintpal/rules/` so the workflow can load the rules.
|
|
58
86
|
The selected remote provider receives bounded source context and rule text.
|
|
59
87
|
Check whether that transfer is permitted for your repository before adding
|
|
60
88
|
`TYPESAFE_API_KEY` as an Actions secret; see [privacy](docs/architecture/privacy.md).
|
|
@@ -81,15 +109,19 @@ jobs:
|
|
|
81
109
|
- uses: actions/setup-node@v6
|
|
82
110
|
with:
|
|
83
111
|
node-version: 24
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
112
|
+
- run: npm install -g lintpal
|
|
113
|
+
- name: Lint pull request
|
|
114
|
+
run: |
|
|
115
|
+
mkdir -p .artifacts/lintpal
|
|
116
|
+
lintpal lint --no-env-file --provider jev \
|
|
117
|
+
--base ${{ github.event.pull_request.base.sha }} \
|
|
118
|
+
--head ${{ github.event.pull_request.head.sha }} \
|
|
119
|
+
--block-on high --format json --out .artifacts/lintpal/findings.json
|
|
91
120
|
env:
|
|
92
121
|
TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
|
|
122
|
+
- name: Publish review and apply gate
|
|
123
|
+
run: lintpal feedback github --in .artifacts/lintpal/findings.json --gate
|
|
124
|
+
env:
|
|
93
125
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
94
126
|
- uses: actions/upload-artifact@v4
|
|
95
127
|
if: always()
|
|
@@ -101,11 +133,14 @@ jobs:
|
|
|
101
133
|
|
|
102
134
|
Open a same-repository pull request. LintPal publishes a review with
|
|
103
135
|
`No blocking findings`, `1 blocking finding`, or `N blocking findings`, plus
|
|
104
|
-
one inline comment for each finding GitHub can attach to the diff. The
|
|
105
|
-
|
|
136
|
+
one inline comment for each finding GitHub can attach to the diff. The gate
|
|
137
|
+
runs after publication; the workflow keeps `.artifacts/lintpal/findings.json`
|
|
138
|
+
even when a blocking finding fails the job. Draft and fork pull requests are
|
|
139
|
+
skipped. GitHub supplies the pull-request context to the feedback command.
|
|
106
140
|
|
|
107
|
-
See the [
|
|
108
|
-
|
|
141
|
+
See the [CLI reference](docs/reference/cli.md) for provider selection,
|
|
142
|
+
feedback commands, and exit codes. The [LintPal Action](https://github.com/diffpal/lintpal-action)
|
|
143
|
+
is also available for workflows that prefer an Action wrapper.
|
|
109
144
|
|
|
110
145
|
## Write Rules in Markdown
|
|
111
146
|
|
|
@@ -127,10 +162,10 @@ through the same pull-request process as code. LintPal ships without hidden or
|
|
|
127
162
|
built-in mandates.
|
|
128
163
|
|
|
129
164
|
```bash
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
165
|
+
lintpal rule list
|
|
166
|
+
lintpal rule view general/authorization.md
|
|
167
|
+
lintpal rule validate
|
|
168
|
+
lintpal rule import github:diffpal/lintpal-rules//go@v1.1.0
|
|
134
169
|
```
|
|
135
170
|
|
|
136
171
|
Read [rule authoring](docs/rules/authoring.md) for the complete format and
|
|
@@ -142,21 +177,25 @@ Check uncommitted changes in your working tree before committing, or compare two
|
|
|
142
177
|
|
|
143
178
|
```bash
|
|
144
179
|
export TYPESAFE_API_KEY='your-provider-key'
|
|
145
|
-
|
|
180
|
+
lintpal doctor
|
|
146
181
|
|
|
147
182
|
# Lint uncommitted working-tree changes (staged, unstaged, and untracked regular files)
|
|
148
|
-
|
|
183
|
+
lintpal lint --uncommitted
|
|
149
184
|
|
|
150
185
|
# Or lint committed revisions
|
|
151
|
-
|
|
186
|
+
lintpal lint --base origin/main --head HEAD
|
|
152
187
|
```
|
|
153
188
|
|
|
189
|
+
Committed comparisons start at the unique merge base of base and head; changes
|
|
190
|
+
found only on the base branch are excluded. See the [CLI reference](docs/reference/cli.md)
|
|
191
|
+
for report revision fields and uncommitted behavior.
|
|
192
|
+
|
|
154
193
|
Markdown findings go to stdout. Use `--out` to retain the complete JSON
|
|
155
194
|
artifact, or `--format json` for JSON on stdout. The default gate returns exit
|
|
156
195
|
code `10` when a high or critical finding blocks the run.
|
|
157
196
|
|
|
158
|
-
|
|
159
|
-
|
|
197
|
+
Choose TypeSafe/Jev, OpenRouter, OpenAI, or a custom compatible endpoint
|
|
198
|
+
from [Supported Providers](#supported-providers). Provider credentials stay in environment variables; the
|
|
160
199
|
selected provider receives bounded source context and rule text.
|
|
161
200
|
See [configuration](docs/guides/configuration.md) and [privacy](docs/architecture/privacy.md).
|
|
162
201
|
|
package/bin/lintpal
CHANGED
|
Binary file
|
package/package.json
CHANGED