|
| 1 | +# our own compliance check |
| 2 | +[group('Compliance')] |
| 3 | +compliance_check: |
| 4 | + #!/usr/bin/env bash |
| 5 | + set -euo pipefail # strict mode without tracing |
| 6 | + |
| 7 | + echo "{{BLUE}}Chicks' repo compliance check...{{NORMAL}}" |
| 8 | + |
| 9 | + if [[ -e README.md ]]; then |
| 10 | + echo "{{GREEN}}You have a README.md, thank you.{{NORMAL}}" |
| 11 | + else |
| 12 | + echo "{{RED}}You do NOT have a README.md, hmmmm, why is this repo here?{{NORMAL}}" |
| 13 | + fi |
| 14 | + |
| 15 | + if [[ -e LICENSE ]]; then |
| 16 | + echo "{{GREEN}}[gh] You have a license, good for you.{{NORMAL}}" |
| 17 | + else |
| 18 | + echo "{{RED}}[gh] You do NOT have a license, are you feeling ok?{{NORMAL}}" |
| 19 | + fi |
| 20 | + |
| 21 | + if [[ -e .github/CODE_OF_CONDUCT.md ]]; then |
| 22 | + echo "{{GREEN}}[gh] You have a Code of Conduct, respect.{{NORMAL}}" |
| 23 | + else |
| 24 | + echo "{{RED}}[gh] You do NOT have a Code of Conduct. So anything goes around here?{{NORMAL}}" |
| 25 | + fi |
| 26 | + |
| 27 | + if [[ -e .github/CONTRIBUTING.md ]]; then |
| 28 | + echo "{{GREEN}}[gh] You have a Contributing Guide, how giving.{{NORMAL}}" |
| 29 | + else |
| 30 | + echo "{{RED}}[gh] You do NOT have a Contributing Guide. Hopefully they'll figure it out on their own.{{NORMAL}}" |
| 31 | + fi |
| 32 | + |
| 33 | + if [[ -e .github/SECURITY.md ]]; then |
| 34 | + echo "{{GREEN}}[gh] You have a Security Guide, very comforting.{{NORMAL}}" |
| 35 | + else |
| 36 | + echo "{{RED}}[gh] You do NOT have a Security Guide. Don't call the cops.{{NORMAL}}" |
| 37 | + fi |
| 38 | + |
| 39 | + if [[ -e .github/pull_request_template.md ]]; then |
| 40 | + echo "{{GREEN}}[gh] You have a pull request template, not too pushy.{{NORMAL}}" |
| 41 | + else |
| 42 | + echo "{{RED}}[gh] You do NOT have a pull request template. Prepare for anything.{{NORMAL}}" |
| 43 | + fi |
| 44 | + |
| 45 | + if [[ -d .github/ISSUE_TEMPLATE ]]; then |
| 46 | + echo "{{GREEN}}[gh] You have Issue Templates, life is good.{{NORMAL}}" |
| 47 | + else |
| 48 | + echo "{{RED}}[gh] You do NOT have Issue Templates. I must take issue with that.{{NORMAL}}" |
| 49 | + fi |
| 50 | + |
| 51 | + if [[ $(gh repo view --json description | jq -r '.description' | wc -c) -gt 16 ]]; then |
| 52 | + echo "{{GREEN}}[gh] You have a repo description, more evidence that you are undescribable.{{NORMAL}}" |
| 53 | + else |
| 54 | + echo "{{RED}}[gh] You do NOT have a repo description, can you write a word or two please?{{NORMAL}}" |
| 55 | + fi |
| 56 | + |
| 57 | + # github also checks for something about the repo admins |
| 58 | + |
| 59 | + if [[ -e .github/CODEOWNERS ]]; then |
| 60 | + echo "{{GREEN}}You have a CODEOWNERS file, in DEED.{{NORMAL}}" |
| 61 | + else |
| 62 | + echo "{{RED}}You do NOT have a CODEOWNERS file. Does anyone want to make a claim?{{NORMAL}}" |
| 63 | + fi |
| 64 | + |
| 65 | + if [[ -e .gitignore ]]; then |
| 66 | + echo "{{GREEN}}You have a .gitignore file, so there will be less debris in your future.{{NORMAL}}" |
| 67 | + else |
| 68 | + echo "{{RED}}You do NOT have a .gitignore file. I expect you to keep ignoring my advice!{{NORMAL}}" |
| 69 | + fi |
| 70 | + |
| 71 | + if [[ -e .gitattributes ]]; then |
| 72 | + echo "{{GREEN}}You have a .gitattributes file, keeping metadata and line endings clean too.{{NORMAL}}" |
| 73 | + else |
| 74 | + echo "{{RED}}You do NOT have a .gitattributes file. Did you hear what happens when binaries and text files get together?{{NORMAL}}" |
| 75 | + fi |
| 76 | + |
| 77 | + if [[ -e justfile ]]; then |
| 78 | + echo "{{GREEN}}You have a {{BLUE}}justfile{{GREEN}}, spreading justice and automation a little further.{{NORMAL}}" |
| 79 | + else |
| 80 | + echo "{{RED}}You do NOT have a justfile. Feeling the FOMO yet?{{NORMAL}}" |
| 81 | + echo "{{RED}}And this should not be possible. Tell me how you got here.{{NORMAL}}" |
| 82 | + fi |
| 83 | + |
| 84 | + if [[ -e .editorconfig ]]; then |
| 85 | + echo "{{GREEN}}You have an {{BLUE}}.editorconfig{{GREEN}}, keeping tabs and spaces segregated.{{NORMAL}}" |
| 86 | + else |
| 87 | + echo "{{RED}}You do NOT have an .editorconfig. Will your world explode when the tabs and spaces get together?{{NORMAL}}" |
| 88 | + fi |
0 commit comments