Skip to content

Commit ea75d62

Browse files
committed
fix: add summary output
Signed-off-by: Josef Andersson <josef.andersson@digg.se>
1 parent f4180ae commit ea75d62

File tree

13 files changed

+251
-65
lines changed

13 files changed

+251
-65
lines changed

README.md

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ Override `lint-all` in your justfile to add Java, Node, Python, etc.:
113113
java_lint := devtools_dir + "/linters/java"
114114
115115
# Extend base linters with Java-specific ones
116-
lint-all: lint-base lint-java
116+
lint-all: _ensure-devtools lint-java
117+
#!/usr/bin/env bash
118+
source "{{colors}}"
119+
just --justfile {{devtools_dir}}/justfile lint-base
120+
just_success "All linting checks completed"
117121
118122
lint-java:
119123
@{{java_lint}}/lint.sh
@@ -127,7 +131,11 @@ See [`examples/java-justfile`](examples/java-justfile) for a complete example.
127131
node_lint := devtools_dir + "/linters/node"
128132
129133
# Extend base linters with Node linters
130-
lint-all: lint-base lint-node
134+
lint-all: _ensure-devtools lint-node
135+
#!/usr/bin/env bash
136+
source "{{colors}}"
137+
just --justfile {{devtools_dir}}/justfile lint-base
138+
just_success "All linting checks completed"
131139
132140
lint-node:
133141
@{{node_lint}}/lint.sh
@@ -139,7 +147,11 @@ See [`examples/node-justfile`](examples/node-justfile) for a complete example.
139147

140148
```just
141149
# Extend base linters with Python linters
142-
lint-all: lint-base lint-python
150+
lint-all: _ensure-devtools lint-python
151+
#!/usr/bin/env bash
152+
source "{{colors}}"
153+
just --justfile {{devtools_dir}}/justfile lint-base
154+
just_success "All linting checks completed"
143155
144156
lint-python:
145157
#!/usr/bin/env bash
@@ -154,7 +166,11 @@ lint-python:
154166

155167
```just
156168
# Extend base linters with Go linters
157-
lint-all: lint-base lint-go
169+
lint-all: _ensure-devtools lint-go
170+
#!/usr/bin/env bash
171+
source "{{colors}}"
172+
just --justfile {{devtools_dir}}/justfile lint-base
173+
just_success "All linting checks completed"
158174
159175
lint-go:
160176
#!/usr/bin/env bash
@@ -169,7 +185,11 @@ lint-go:
169185

170186
```just
171187
# Extend base linters with Rust linters
172-
lint-all: lint-base lint-rust
188+
lint-all: _ensure-devtools lint-rust
189+
#!/usr/bin/env bash
190+
source "{{colors}}"
191+
just --justfile {{devtools_dir}}/justfile lint-base
192+
just_success "All linting checks completed"
173193
174194
lint-rust:
175195
#!/usr/bin/env bash
@@ -183,14 +203,19 @@ lint-rust:
183203
### Minimal Project (base linters only)
184204

185205
```just
186-
# Default behavior - no need to override
187-
# Just run: just lint-all
206+
# Run all linters (uses base linters only)
207+
lint-all: _ensure-devtools
208+
@just --justfile {{devtools_dir}}/justfile lint-base
188209
```
189210

190211
### Multiple Languages
191212

192213
```just
193-
lint-all: lint-base lint-java lint-python lint-ts
214+
lint-all: _ensure-devtools lint-java lint-python lint-node
215+
#!/usr/bin/env bash
216+
source "{{colors}}"
217+
just --justfile {{devtools_dir}}/justfile lint-base
218+
just_success "All linting checks completed"
194219
```
195220

196221
## Utilities

linters/commits.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,27 @@ has_commits_to_check() {
2323
main() {
2424
print_header "COMMIT HEALTH (CONFORM)"
2525

26-
if ! command -v conform >/dev/null 2>&1; then
27-
print_error "conform not found. Install with: mise install"
28-
return 1
29-
fi
30-
3126
local current_branch default_branch
3227
current_branch=$(git branch --show-current)
3328
default_branch=$(get_default_branch)
3429

3530
# Skip if on the base branch itself (conform can't handle base..HEAD when they're the same)
3631
if [[ "$current_branch" == "$default_branch" ]]; then
37-
print_info "On ${default_branch} - checking HEAD commit only"
38-
if conform enforce 2>/dev/null; then
39-
print_success "Commit health check passed"
40-
return 0
41-
else
42-
print_error "Commit health check failed - check your commit messages"
43-
return 1
44-
fi
32+
print_info "On ${default_branch} - no commits to check against base branch"
33+
return 0
4534
fi
4635

4736
if ! has_commits_to_check "$default_branch"; then
4837
print_info "No commits to check on ${current_branch} (compared to ${default_branch})"
4938
return 0
5039
fi
5140

41+
if ! command -v conform >/dev/null 2>&1; then
42+
print_warning "conform not found in PATH - skipping commit linting"
43+
echo " Install: mise install"
44+
return 0
45+
fi
46+
5247
if conform enforce --base-branch="${default_branch}" 2>/dev/null; then
5348
print_success "Commit health check passed"
5449
return 0

linters/container.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ find_containerfiles() {
1616
main() {
1717
print_header "CONTAINER LINTING (HADOLINT)"
1818

19-
if ! command -v hadolint >/dev/null 2>&1; then
20-
print_error "hadolint not found. Install with: mise install"
21-
return 1
22-
fi
23-
2419
local files
2520
files=$(find_containerfiles)
2621

2722
if [[ -z "$files" ]]; then
28-
print_warning "No Containerfile/Dockerfile found to check"
23+
print_info "No Containerfile/Dockerfile found to check"
24+
return 0
25+
fi
26+
27+
if ! command -v hadolint >/dev/null 2>&1; then
28+
print_warning "hadolint not found in PATH - skipping container linting"
29+
echo " Install: mise install"
2930
return 0
3031
fi
3132

linters/github-actions.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ main() {
1313
print_header "GITHUB ACTIONS LINTING (ACTIONLINT)"
1414

1515
if [[ ! -d .github/workflows ]]; then
16-
print_warning "No GitHub Actions workflows found, skipping"
16+
print_info "No GitHub Actions workflows found to check"
1717
return 0
1818
fi
1919

2020
if ! command -v actionlint >/dev/null 2>&1; then
21-
print_error "actionlint not found. Install with: mise install"
22-
return 1
21+
print_warning "actionlint not found in PATH - skipping GitHub Actions linting"
22+
echo " Install: mise install"
23+
return 0
2324
fi
2425

2526
if actionlint; then

linters/license.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ main() {
1313
print_header "LICENSE COMPLIANCE (REUSE)"
1414

1515
if ! command -v reuse >/dev/null 2>&1; then
16-
print_error "reuse not found. Install with: mise install"
17-
return 1
16+
print_warning "reuse not found in PATH - skipping license compliance check"
17+
echo " Install: mise install"
18+
return 0
1819
fi
1920

2021
if reuse lint; then

linters/markdown.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source "${SCRIPT_DIR}/../utils/colors.sh"
1111

1212
readonly ACTION="${1:-check}"
1313
shift || true
14-
readonly DISABLE="${1:-}"
14+
readonly DISABLE="${1:-MD013}"
1515

1616
check_markdown() {
1717
local args=(check .)
@@ -41,8 +41,9 @@ main() {
4141
print_header "MARKDOWN LINTING (RUMDL)"
4242

4343
if ! command -v rumdl >/dev/null 2>&1; then
44-
print_error "rumdl not found. Install with: mise install"
45-
return 1
44+
print_warning "rumdl not found in PATH - skipping markdown linting"
45+
echo " Install: mise install"
46+
return 0
4647
fi
4748

4849
case "$ACTION" in

linters/secrets.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ main() {
2121
print_header "SECRET SCANNING (GITLEAKS)"
2222

2323
if ! command -v gitleaks >/dev/null 2>&1; then
24-
print_error "gitleaks not found. Install with: mise install"
25-
return 1
24+
print_warning "gitleaks not found in PATH - skipping secret scanning"
25+
echo " Install: mise install"
26+
return 0
2627
fi
2728

2829
local default_branch current_branch

linters/shell-fmt.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@ fix_format() {
4040
main() {
4141
print_header "SHELL SCRIPT FORMATTING (SHFMT)"
4242

43-
if ! command -v shfmt >/dev/null 2>&1; then
44-
print_error "shfmt not found. Install with: mise install"
45-
return 1
46-
fi
47-
4843
local scripts
4944
scripts=$(find_shell_scripts)
5045

5146
if [[ -z "$scripts" ]]; then
52-
print_warning "No shell scripts found to format"
47+
print_info "No shell scripts found to format"
48+
return 0
49+
fi
50+
51+
if ! command -v shfmt >/dev/null 2>&1; then
52+
print_warning "shfmt not found in PATH - skipping shell formatting"
53+
echo " Install: mise install"
5354
return 0
5455
fi
5556

linters/shell.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ find_shell_scripts() {
1616
main() {
1717
print_header "SHELL SCRIPT LINTING (SHELLCHECK)"
1818

19-
if ! command -v shellcheck >/dev/null 2>&1; then
20-
print_error "shellcheck not found. Install with: mise install"
21-
return 1
22-
fi
23-
2419
local scripts
2520
scripts=$(find_shell_scripts)
2621

2722
if [[ -z "$scripts" ]]; then
28-
print_warning "No shell scripts found to check"
23+
print_info "No shell scripts found to check"
24+
return 0
25+
fi
26+
27+
if ! command -v shellcheck >/dev/null 2>&1; then
28+
print_warning "shellcheck not found in PATH - skipping shell linting"
29+
echo " Install: mise install"
2930
return 0
3031
fi
3132

linters/xml.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ main() {
2020
files=$(find_xml_files)
2121

2222
if [[ -z "$files" ]]; then
23-
print_warning "No XML files found to check"
23+
print_info "No XML files found to check"
2424
return 0
2525
fi
2626

2727
if ! command -v xmllint >/dev/null 2>&1; then
28-
print_warning "xmllint not found - skipping XML linting"
28+
print_warning "xmllint not found in PATH - skipping XML linting"
2929
echo " Install: Ubuntu/Debian: sudo apt install libxml2-utils"
3030
echo " Fedora/RHEL: sudo dnf install libxml2"
3131
echo " macOS: brew install libxml2"

0 commit comments

Comments
 (0)