@diffpal/lintpal-darwin-arm64 0.4.1 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +144 -49
  2. package/bin/lintpal +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,72 +1,167 @@
1
1
  # LintPal
2
2
 
3
- [![Test](https://github.com/diffpal/lintpal/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/diffpal/lintpal/actions/workflows/test.yml)
4
- [![npm version](https://img.shields.io/npm/v/lintpal)](https://www.npmjs.com/package/lintpal)
5
- [![License: MIT](https://img.shields.io/github/license/diffpal/lintpal)](LICENSE)
3
+ [![ci](https://github.com/diffpal/lintpal/actions/workflows/ci.yml/badge.svg)](https://github.com/diffpal/lintpal/actions/workflows/ci.yml)
4
+ [![lintpal-dev review](https://github.com/diffpal/lintpal/actions/workflows/lintpal-dev-review.yml/badge.svg)](https://github.com/diffpal/lintpal/actions/workflows/lintpal-dev-review.yml)
5
+ [![npm](https://img.shields.io/npm/v/lintpal?label=npm)](https://www.npmjs.com/package/lintpal)
6
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
6
7
 
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.
8
+ **Turn plain-English engineering rules into pull-request checks.**
11
9
 
12
- ## Start
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
- Install LintPal in your project, or use `npx lintpal` directly:
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)
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
- 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
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
- 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).
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
- 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.
104
+ ## Write Rules in Markdown
37
105
 
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.
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
- ## Work with rules
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
- 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.
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 go/errors.md
125
+ npx lintpal rule view general/authorization.md
54
126
  npx lintpal rule validate
55
- npx lintpal rule import ./team-rules --prefix team
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
- `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.
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
- ## Learn more
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
- - [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)
165
+ ## License
69
166
 
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).
167
+ LintPal is released under the [MIT License](LICENSE).
package/bin/lintpal CHANGED
Binary file
package/package.json CHANGED
@@ -17,5 +17,5 @@
17
17
  "type": "git",
18
18
  "url": "git+https://github.com/diffpal/lintpal.git"
19
19
  },
20
- "version": "0.4.1"
20
+ "version": "0.5.0"
21
21
  }