You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reusable linting scripts for [Just](https://github.com/casey/just) task runner. Install once to `~/.local/share/devbase-justkit`, use across multiple projects.
16
+
Reusable linting for [Just](https://github.com/casey/just) task runner. Install once, use across multiple projects.
17
17
18
18
## What it does
19
19
20
-
- Runs 10+ linters (shellcheck, yamlfmt, gitleaks, etc.) with one command
21
-
-Skip what you don't need - no XML files? No XML linting
20
+
- Runs linters (shellcheck, yamlfmt, gitleaks, etc.) with one command
21
+
-Skips what you don't need - no XML files? No XML linting
22
22
- Add language-specific linters (Java, Node/TypeScript) on top
23
23
- Centralized linting - update once, affects all projects
24
24
- No copy-paste of linter scripts and configs between projects
25
25
26
26
## Requirements
27
27
28
-
-[Just](https://github.com/casey/just) - task runner (install: `cargo install just` or see [Just installation](https://github.com/casey/just#installation))
29
-
-[mise](https://mise.jdx.dev/) - tool version manager (install: `curl https://mise.run | sh` or see [mise installation](https://mise.jdx.dev/getting-started.html))
|`lint-shell-fmt`| shfmt | Shell formatting | No .sh/.bash files |
77
78
|`lint-actions`| actionlint | GitHub Actions syntax | No .github/workflows/ |
78
79
|`lint-license`| reuse | License compliance | Never (scans all) |
79
80
|`lint-container`| hadolint | Dockerfile best practices | No Containerfile/Dockerfile |
@@ -105,33 +106,46 @@ Run on every project. Skip automatically if no relevant files found:
105
106
106
107
## Add language-specific linters
107
108
108
-
Override `lint-all` in your justfile to add Java, Node, Python, etc.:
109
+
Add language-specific recipes to your justfile. The `verify.sh` script (called by `just verify`) **automatically detects** recipes with these names and includes them in the summary:
No need to override `lint-all` - just define the recipes and they're picked up automatically.
109
115
110
116
### Java/Maven Project
111
117
112
118
```just
113
119
java_lint := devtools_dir + "/linters/java"
114
120
115
-
# Run all linters with summary (automatically detects Java linters)
116
-
lint-all: _ensure-devtools
117
-
@{{devtools_dir}}/scripts/verify.sh
118
-
119
121
# Run all Java linters together (convenience command)
122
+
[group('lint')]
120
123
lint-java:
121
124
@{{java_lint}}/lint.sh
122
125
123
126
# Individual Java linters (auto-detected by verify.sh)
127
+
[group('lint')]
124
128
lint-java-checkstyle:
125
129
@{{java_lint}}/checkstyle.sh
126
130
131
+
[group('lint')]
127
132
lint-java-pmd:
128
133
@{{java_lint}}/pmd.sh
129
134
135
+
[group('lint')]
130
136
lint-java-spotbugs:
131
137
@{{java_lint}}/spotbugs.sh
138
+
139
+
[group('lint')]
140
+
lint-java-fmt:
141
+
@{{java_lint}}/format.sh check
142
+
143
+
[group('fix')]
144
+
lint-java-fmt-fix:
145
+
@{{java_lint}}/format.sh fix
132
146
```
133
147
134
-
When you run `just lint-all` or `just verify`, the verify script automatically detects `lint-java-checkstyle`, `lint-java-pmd`, and `lint-java-spotbugs` recipes and runs them individually with a summary table. You can also run `just lint-java` to execute all Java linters together.
148
+
When you run `just verify`, the verify script automatically detects `lint-java-checkstyle`, `lint-java-pmd`, and `lint-java-spotbugs` recipes and includes them in the summary table. You can also run `just lint-java` to execute all Java linters together.
135
149
136
150
See [`examples/java-justfile`](examples/java-justfile) for a complete example.
137
151
@@ -140,86 +154,55 @@ See [`examples/java-justfile`](examples/java-justfile) for a complete example.
140
154
```just
141
155
node_lint := devtools_dir + "/linters/node"
142
156
143
-
# Run all linters with summary (automatically detects Node linters)
144
-
lint-all: _ensure-devtools
145
-
@{{devtools_dir}}/scripts/verify.sh
146
-
147
157
# Run all Node linters together (convenience command)
158
+
[group('lint')]
148
159
lint-node:
149
160
@{{node_lint}}/lint.sh
150
161
151
162
# Individual Node linters (auto-detected by verify.sh)
163
+
[group('lint')]
152
164
lint-node-eslint:
153
165
@{{node_lint}}/eslint.sh
154
166
167
+
[group('lint')]
155
168
lint-node-format:
156
169
@{{node_lint}}/format.sh check
157
170
171
+
[group('lint')]
158
172
lint-node-ts-types:
159
173
@{{node_lint}}/types.sh
174
+
175
+
[group('fix')]
176
+
lint-node-format-fix:
177
+
@{{node_lint}}/format.sh fix
160
178
```
161
179
162
-
When you run `just lint-all` or `just verify`, the verify script automatically detects `lint-node-*` recipes and runs them individually with a summary table. You can also run `just lint-node` to execute all Node linters together.
180
+
When you run `just verify`, the verify script automatically detects `lint-node-*` recipes and includes them in the summary table. You can also run `just lint-node` to execute all Node linters together.
163
181
164
182
See [`examples/node-justfile`](examples/node-justfile) for a complete example.
165
183
166
-
### Python Project
167
-
168
-
```just
169
-
# Extend base linters with Python linters
170
-
lint-all: _ensure-devtools lint-python
171
-
#!/usr/bin/env bash
172
-
source "{{colors}}"
173
-
just --justfile {{devtools_dir}}/justfile lint-base
174
-
just_success "All linting checks completed"
175
-
176
-
lint-python:
177
-
#!/usr/bin/env bash
178
-
source "{{colors}}"
179
-
just_header "Python Linting" "ruff check"
180
-
ruff check .
181
-
ruff format --check .
182
-
just_success "Python linting passed"
183
-
```
184
-
185
184
### Go Project
186
185
187
186
```just
188
-
# Extend base linters with Go linters
189
-
lint-all: _ensure-devtools lint-go
190
-
#!/usr/bin/env bash
191
-
source "{{colors}}"
192
-
just --justfile {{devtools_dir}}/justfile lint-base
193
-
just_success "All linting checks completed"
194
-
187
+
# Go linter (add to verify.sh detection if needed)
188
+
[group('lint')]
195
189
lint-go:
196
-
#!/usr/bin/env bash
197
-
source "{{colors}}"
198
-
just_header "Go Linting" "golangci-lint run"
199
190
go vet ./...
200
191
golangci-lint run
201
-
just_success "Go linting passed"
202
192
```
203
193
204
194
### Rust Project
205
195
206
196
```just
207
-
# Extend base linters with Rust linters
208
-
lint-all: _ensure-devtools lint-rust
209
-
#!/usr/bin/env bash
210
-
source "{{colors}}"
211
-
just --justfile {{devtools_dir}}/justfile lint-base
212
-
just_success "All linting checks completed"
213
-
197
+
# Rust linters (add to verify.sh detection if needed)
198
+
[group('lint')]
214
199
lint-rust:
215
-
#!/usr/bin/env bash
216
-
source "{{colors}}"
217
-
just_header "Rust Linting" "cargo clippy"
218
200
cargo fmt --check
219
201
cargo clippy -- -D warnings
220
-
just_success "Rust linting passed"
221
202
```
222
203
204
+
> **Note:** Go and Rust linters are not auto-detected by `verify.sh` yet. You can add detection in `scripts/verify.sh` following the Java/Node pattern, or run them separately with `just lint-go` / `just lint-rust`.
205
+
223
206
### Minimal Project (base linters only)
224
207
225
208
```just
@@ -239,10 +222,6 @@ lint-all: _ensure-devtools
239
222
lint-java-checkstyle:
240
223
@{{java_lint}}/checkstyle.sh
241
224
242
-
# Python linters
243
-
lint-python:
244
-
ruff check .
245
-
246
225
# Node linters
247
226
lint-node-eslint:
248
227
@{{node_lint}}/eslint.sh
@@ -254,25 +233,31 @@ All defined `lint-*` recipes are automatically detected and included in the summ
254
233
255
234
You can override any linter recipe in your project's justfile to customize behavior or skip checks.
256
235
257
-
### Skip a Linter
236
+
### Disable or Skip a Linter
258
237
259
-
To skip a linter completely, override the recipe and output a message containing "Skip" or "Skipping". The verify script will mark it as skipped (yellow `-`) in the summary:
238
+
Two options to disable a linter:
239
+
240
+
**Option 1: Hide completely** - empty recipe (no output), linter won't appear in summary:
260
241
261
242
```just
262
-
# Skip license compliance checks
243
+
[group('lint')]
263
244
lint-license:
264
-
@echo "Skipping license check"
245
+
```
265
246
266
-
# Skip a Java linter
267
-
lint-java-checkstyle:
268
-
@echo "Skipping Checkstyle"
247
+
**Option 2: Show as skipped** - output message containing "Skip", shown as skipped in summary:
248
+
249
+
```just
250
+
[group('lint')]
251
+
lint-license:
252
+
@echo "Skipping license check - not required for this project"
0 commit comments