jj/.github/scripts/dragon-bureaucrat
Austin Seipp b1bb5e1cf9 github: ward off future dependency bloat via dragon
After some discussion on Discord yesterday, Emily floated this idea to
have a check that fails if `Cargo.lock` has too many dependencies, where
"too many" means "more than a random number I made up and sounds good."

This implements that, as a non-required check, and to do so it invokes
the power of an extremely evil and annoying Dragon. We could also ask
this Dragon to do other things too I suppose (pending future contract
negotiations).

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-04-04 21:19:23 +00:00

39 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
# This script invokes the forbidden power of an ancient evil in order to defend
# the one thing we hold most dear: bureaucratic norms
# Many thanks to Phabricator (and Evan) for the vintage ASCII art (Apache 2.0)
# <https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/scripts/repository/commit_hook.php#L203>
rejection_reason=${1:-"No reason provided. The Dragons have spoken."}
cat >&2 <<'EOF'
+---------------------------------------------------------------+
| * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * |
+---------------------------------------------------------------+
\
\ ^ /^
\ / \ // \
\ |\___/| / \// .\
\ /V V \__ / // | \ \ *----*
/ / \/_/ // | \ \ \ |
@___@` \/_ // | \ \ \/\ \
0/0/| \/_ // | \ \ \ \
0/0/0/0/| \/// | \ \ | |
0/0/0/0/0/_|_ / ( // | \ _\ | /
0/0/0/0/0/0/`/,_ _ _/ ) ; -. | _ _\.-~ / /
,-} _ *-.|.-~-. .~ ~
* \__/ `/\ / ~-. _ .-~ /
\____(Oo) *. } { /
( (..) .----~-.\ \-` .~
//___\\\\ \ DENIED! ///.----..< \ _ -~
// \\\\ ///-._ _ _ _ _ _ _{^ - - - - ~
EOF
cat >&2 <<EOF
$rejection_reason
EOF
exit 1