Skip to content

Commit abe683e

Browse files
committed
feat(crg): add crg-grade and crg-badge justfile recipes
1 parent 57d2896 commit abe683e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Justfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,21 @@ help-me:
306306
@echo " https://github.com/hyperpolymath/universal-language-server-plugin/issues/new"
307307
@echo ""
308308
@echo "Include the output of 'just doctor' in your report."
309+
310+
311+
# Print the current CRG grade (reads from READINESS.md '**Current Grade:** X' line)
312+
crg-grade:
313+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
314+
[ -z "$$grade" ] && grade="X"; \
315+
echo "$$grade"
316+
317+
# Generate a shields.io badge markdown for the current CRG grade
318+
# Looks for '**Current Grade:** X' in READINESS.md; falls back to X
319+
crg-badge:
320+
@grade=$$(grep -oP '(?<=\*\*Current Grade:\*\* )[A-FX]' READINESS.md 2>/dev/null | head -1); \
321+
[ -z "$$grade" ] && grade="X"; \
322+
case "$$grade" in \
323+
A) color="brightgreen" ;; B) color="green" ;; C) color="yellow" ;; \
324+
D) color="orange" ;; E) color="red" ;; F) color="critical" ;; \
325+
*) color="lightgrey" ;; esac; \
326+
echo "[![CRG $$grade](https://img.shields.io/badge/CRG-$$grade-$$color?style=flat-square)](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)"

0 commit comments

Comments
 (0)