Skip to content

Commit a37b3e7

Browse files
authored
📣 [just] add compliance check (#3)
1 parent 52efa3d commit a37b3e7

File tree

1 file changed

+84
-1
lines changed

1 file changed

+84
-1
lines changed

justfile

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,87 @@ main_branch:
104104
[group('Utility')]
105105
[no-cd]
106106
@utcdate:
107-
TZ=UTC date +"%Y-%m-%d"
107+
TZ=UTC date +"%Y-%m-%d"
108+
109+
# our own compliance check
110+
[group('Compliance')]
111+
compliance_check:
112+
#!/usr/bin/env bash
113+
set -euo pipefail # strict mode without tracing
114+
115+
echo "{{BLUE}}Chicks' repo compliance check...{{NORMAL}}"
116+
117+
if [[ -e README.md ]]; then
118+
echo "{{GREEN}}You have a README.md, thank you.{{NORMAL}}"
119+
else
120+
echo "{{RED}}You do NOT have a README.md, hmmmm, why is this repo here?{{NORMAL}}"
121+
fi
122+
123+
if [[ -e LICENSE ]]; then
124+
echo "{{GREEN}}[gh] You have a license, good for you.{{NORMAL}}"
125+
else
126+
echo "{{RED}}You do NOT have a license, are you feeling ok?{{NORMAL}}"
127+
fi
128+
129+
if [[ -e .github/CODE_OF_CONDUCT.md ]]; then
130+
echo "{{GREEN}}[gh] You have a Code of Conduct, respect.{{NORMAL}}"
131+
else
132+
echo "{{RED}}You do NOT have a Code of Conduct. So anything goes around here?{{NORMAL}}"
133+
fi
134+
135+
if [[ -e .github/CONTRIBUTING.md ]]; then
136+
echo "{{GREEN}}[gh] You have a Contributing Guide, how giving.{{NORMAL}}"
137+
else
138+
echo "{{RED}}You do NOT have a Contributing Guide. Hopefully they'll figure it out on their own.{{NORMAL}}"
139+
fi
140+
141+
if [[ -e .github/SECURITY.md ]]; then
142+
echo "{{GREEN}}[gh] You have a Security Guide, very comforting.{{NORMAL}}"
143+
else
144+
echo "{{RED}}You do NOT have a Security Guide. Don't call the cops.{{NORMAL}}"
145+
fi
146+
147+
if [[ -e .github/pull_request_template.md ]]; then
148+
echo "{{GREEN}}[gh] You have a pull request template, not too pushy.{{NORMAL}}"
149+
else
150+
echo "{{RED}}You do NOT have a pull request template. Prepare for anything.{{NORMAL}}"
151+
fi
152+
153+
if [[ -d .github/ISSUE_TEMPLATE ]]; then
154+
echo "{{GREEN}}[gh] You have Issue Templates, life is good.{{NORMAL}}"
155+
else
156+
echo "{{RED}}You do NOT have Issue Templates. I must take issue with that.{{NORMAL}}"
157+
fi
158+
159+
if [[ $(gh repo view --json description | jq -r '.description' | wc -c) -gt 16 ]]; then
160+
echo "{{GREEN}}[gh] You have a repo description, more evidence that you are undescribable.{{NORMAL}}"
161+
else
162+
echo "{{RED}}You do NOT have a repo description, can you write a word or two please?{{NORMAL}}"
163+
fi
164+
165+
# github also checks for something about the repo admins
166+
167+
if [[ -e .github/CODEOWNERS ]]; then
168+
echo "{{GREEN}}You have a CODEOWNERS file, in DEED.{{NORMAL}}"
169+
else
170+
echo "{{RED}}You do NOT have a CODEOWNERS file. Does anyone want to make a claim?{{NORMAL}}"
171+
fi
172+
173+
if [[ -e .gitignore ]]; then
174+
echo "{{GREEN}}You have a .gitignore file, so there will be less debris in your future.{{NORMAL}}"
175+
else
176+
echo "{{RED}}You do NOT have a .gitignore file. I expect you to keep ignoring my advice!{{NORMAL}}"
177+
fi
178+
179+
if [[ -e .gitattributes ]]; then
180+
echo "{{GREEN}}You have a .gitattributes file, keeping metadata and line endings clean too.{{NORMAL}}"
181+
else
182+
echo "{{RED}}You do NOT have a .gitattributes file. Did you hear what happens when binaries and text files get together?{{NORMAL}}"
183+
fi
184+
185+
if [[ -e justfile ]]; then
186+
echo "{{GREEN}}You have a {{BLUE}}justfile{{GREEN}}, spreading justice and automation a little further.{{NORMAL}}"
187+
else
188+
echo "{{RED}}You do NOT have a justfile. Feeling the FOMO yet?{{NORMAL}}"
189+
echo "{{RED}}And this should not be possible. Tell me how you got here.{{NORMAL}}"
190+
fi

0 commit comments

Comments
 (0)