@diffpal/lintpal-darwin-arm64 0.4.1 → 0.5.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 +144 -49
- package/bin/lintpal +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,72 +1,167 @@
|
|
|
1
1
|
# LintPal
|
|
2
2
|
|
|
3
|
-
[](https://github.com/diffpal/lintpal/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/diffpal/lintpal/actions/workflows/lintpal-dev-review.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/lintpal)
|
|
6
|
+
[](LICENSE)
|
|
6
7
|
|
|
7
|
-
**
|
|
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.
|
|
8
|
+
**Turn plain-English engineering rules into pull-request checks.**
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
LintPal checks committed changes against Markdown rules owned by your
|
|
11
|
+
repository. It produces findings on changed lines, applies a deterministic
|
|
12
|
+
severity gate, and can publish the result directly to GitHub. Use it for
|
|
13
|
+
specific requirements your team wants enforced on every change.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
[Quickstart](docs/getting-started.md) ·
|
|
16
|
+
[Documentation](docs/index.md) ·
|
|
17
|
+
[Rule packs](https://github.com/diffpal/lintpal-rules) ·
|
|
18
|
+
[Demo](https://github.com/diffpal/lintpal-demo/pull/3)
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **Freeform rules:** write one clear requirement per Markdown file, with
|
|
23
|
+
optional severity and decision-threshold policy in frontmatter.
|
|
24
|
+
- **Rule packs:** import a local directory or a versioned GitHub catalog, then
|
|
25
|
+
review and commit the rules with your code.
|
|
26
|
+
- **Gating:** choose which finding severities block CI while retaining the
|
|
27
|
+
complete findings artifact after each successful evaluation.
|
|
28
|
+
- **Platform feedback:** publish a deterministic GitHub review summary and
|
|
29
|
+
inline comments, or consume the same findings as JSON or Markdown in CI.
|
|
30
|
+
|
|
31
|
+
## How It Works
|
|
32
|
+
|
|
33
|
+
| Stage | What LintPal does |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| Rules | Loads the repository's `.lintpal/rules/**/*.md` requirements |
|
|
36
|
+
| Diff | Reads changed lines between two committed Git revisions |
|
|
37
|
+
| Decisions | Evaluates each applicable rule through the configured provider |
|
|
38
|
+
| Findings | Writes line-anchored findings in the shared findings v5 format |
|
|
39
|
+
| Feedback | Publishes inline GitHub comments and applies the configured gate |
|
|
40
|
+
|
|
41
|
+
LintPal is a focused policy checker. It does not generate a narrative code
|
|
42
|
+
review or invent new review criteria during a run.
|
|
43
|
+
|
|
44
|
+
## Minimal GitHub Quickstart
|
|
45
|
+
|
|
46
|
+
Install LintPal and add a versioned rule pack:
|
|
15
47
|
|
|
16
48
|
```bash
|
|
17
49
|
npm install --save-dev lintpal
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
50
|
+
npx lintpal rule import github:diffpal/lintpal-rules//general@v1.1.0
|
|
51
|
+
npx lintpal rule validate
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Add `TYPESAFE_API_KEY` as a repository Actions secret, then create
|
|
55
|
+
`.github/workflows/lintpal.yml`:
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
name: lintpal
|
|
59
|
+
|
|
60
|
+
on:
|
|
61
|
+
pull_request:
|
|
62
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
63
|
+
|
|
64
|
+
jobs:
|
|
65
|
+
lint:
|
|
66
|
+
if: ${{ !github.event.pull_request.draft && github.event.pull_request.head.repo.full_name == github.repository }}
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
permissions:
|
|
69
|
+
contents: read
|
|
70
|
+
pull-requests: write
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v7
|
|
73
|
+
with:
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
- uses: actions/setup-node@v6
|
|
76
|
+
with:
|
|
77
|
+
node-version: 24
|
|
78
|
+
- uses: diffpal/lintpal-action@v1
|
|
79
|
+
with:
|
|
80
|
+
lintpal-version: "0.4.1"
|
|
81
|
+
base: ${{ github.event.pull_request.base.sha }}
|
|
82
|
+
head: ${{ github.event.pull_request.head.sha }}
|
|
83
|
+
block-on: high
|
|
84
|
+
gate: true
|
|
85
|
+
env:
|
|
86
|
+
TYPESAFE_API_KEY: ${{ secrets.TYPESAFE_API_KEY }}
|
|
87
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
88
|
+
- uses: actions/upload-artifact@v4
|
|
89
|
+
if: always()
|
|
90
|
+
with:
|
|
91
|
+
name: lintpal-findings
|
|
92
|
+
path: .artifacts/lintpal/
|
|
93
|
+
if-no-files-found: warn
|
|
24
94
|
```
|
|
25
95
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
96
|
+
Open a same-repository pull request. LintPal publishes a review with
|
|
97
|
+
`No blocking findings`, `1 blocking finding`, or `N blocking findings`, plus
|
|
98
|
+
one inline comment for each finding GitHub can attach to the diff. The workflow
|
|
99
|
+
also keeps `.artifacts/lintpal/findings.json` for later steps.
|
|
100
|
+
|
|
101
|
+
See the [LintPal Action](https://github.com/diffpal/lintpal-action) for every
|
|
102
|
+
input, artifact upload, provider selection, and fork pull-request guidance.
|
|
31
103
|
|
|
32
|
-
|
|
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.
|
|
104
|
+
## Write Rules in Markdown
|
|
37
105
|
|
|
38
|
-
|
|
39
|
-
|
|
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.
|
|
106
|
+
The file path beneath `.lintpal/rules/` is the rule ID. The body is the
|
|
107
|
+
requirement. Optional frontmatter controls its policy:
|
|
43
108
|
|
|
44
|
-
|
|
109
|
+
```markdown
|
|
110
|
+
---
|
|
111
|
+
severity: high
|
|
112
|
+
threshold: 0.97
|
|
113
|
+
title: Unchecked error
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
Handle errors returned by calls when failure changes the result or behavior.
|
|
117
|
+
```
|
|
45
118
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
diff.
|
|
119
|
+
Rules are ordinary project files: review them, version them, and change them
|
|
120
|
+
through the same pull-request process as code. LintPal ships without hidden or
|
|
121
|
+
built-in mandates.
|
|
50
122
|
|
|
51
123
|
```bash
|
|
52
124
|
npx lintpal rule list
|
|
53
|
-
npx lintpal rule view
|
|
125
|
+
npx lintpal rule view general/authorization.md
|
|
54
126
|
npx lintpal rule validate
|
|
55
|
-
npx lintpal rule import
|
|
127
|
+
npx lintpal rule import github:diffpal/lintpal-rules//go@v1.1.0
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Read [rule authoring](docs/rule-authoring.md) for the complete format and
|
|
131
|
+
[rule import](docs/rule-import.md) for local and pinned GitHub sources.
|
|
132
|
+
|
|
133
|
+
## Run Locally
|
|
134
|
+
|
|
135
|
+
Both revisions must be committed and available in the local Git repository:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
export TYPESAFE_API_KEY='your-provider-key'
|
|
139
|
+
npx lintpal doctor
|
|
140
|
+
npx lintpal lint --base origin/main --head HEAD
|
|
56
141
|
```
|
|
57
142
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
143
|
+
Markdown findings go to stdout. Use `--out` to retain the complete JSON
|
|
144
|
+
artifact, or `--format json` for JSON on stdout. The default gate returns exit
|
|
145
|
+
code `10` when a high or critical finding blocks the run.
|
|
146
|
+
|
|
147
|
+
The default provider is Jev. LintPal also supports OpenRouter and a trusted
|
|
148
|
+
custom endpoint. Provider credentials stay in environment variables; the
|
|
149
|
+
selected provider receives bounded committed source context and rule text.
|
|
150
|
+
See [configuration](docs/configuration.md) and [privacy](docs/privacy.md).
|
|
151
|
+
|
|
152
|
+
## Documentation by Goal
|
|
63
153
|
|
|
64
|
-
|
|
154
|
+
| Goal | Start here |
|
|
155
|
+
| --- | --- |
|
|
156
|
+
| Run the first check | [Getting started](docs/getting-started.md) |
|
|
157
|
+
| Configure providers and policy | [Configuration](docs/configuration.md) |
|
|
158
|
+
| Write project rules | [Rule authoring](docs/rule-authoring.md) |
|
|
159
|
+
| Import reusable rule packs | [Rule import](docs/rule-import.md) |
|
|
160
|
+
| Understand findings and gates | [Report reference](docs/report.md) |
|
|
161
|
+
| Automate the CLI | [CLI reference](docs/cli.md) |
|
|
162
|
+
| Review security and data flow | [Privacy](docs/privacy.md) and [architecture](docs/architecture.md) |
|
|
163
|
+
| Contribute to LintPal | [Contributing](CONTRIBUTING.md) |
|
|
65
164
|
|
|
66
|
-
|
|
67
|
-
- [Findings and gates](docs/report.md)
|
|
68
|
-
- [Contributing](CONTRIBUTING.md) and [development tasks](docs/development.md)
|
|
165
|
+
## License
|
|
69
166
|
|
|
70
|
-
|
|
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).
|
|
167
|
+
LintPal is released under the [MIT License](LICENSE).
|
package/bin/lintpal
CHANGED
|
Binary file
|
package/package.json
CHANGED