Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» developer tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Aug 31, 2023
1 parent 1b6a0d1 commit 9e6c687
Show file tree
Hide file tree
Showing 7 changed files with 3,870 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ end_of_line = lf
indent_size = 2
indent_style = tab
insert_final_newline = true
max_line_length = 80
tab_width = 2
trim_trailing_whitespace = true

[*.{yaml,yml}]
[*.{md,py,yaml,yml}]
indent_style = space

[*.py]
indent_size = 4
tab_width = 4
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
docker-compose.override.yml
html/overlay/tmi.min.js
/docker-compose.override.yml
/html/overlay/tmi.min.js
node_modules/

9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: local
hooks:
- id: prettier
name: prettier
args: [prettier, -l, -u, -w]
entry: npx
language: system
types: [text]
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CHANGELOG.md
package-lock.json
21 changes: 21 additions & 0 deletions etc/install-gitmoji-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# install gitmoji as a commit hook
root="$(git rev-parse --show-toplevel)"
hook="$root/.git/hooks/prepare-commit-msg"
cat >"$hook" <<EOF
#!/usr/bin/env bash
# check for skip var
if [[ "\$SKIP_GITMOJI_HOOK" != "" ]]; then exit 0; fi
# check for existing gitmoji (actually check that first character isn't ASCII)
if [[ -f "\$1" ]] && [[ "\$2" == "message" ]] && {
[[ "\$(grep -o -P "^[\\x{0000}-\\x{007f}]" <\$1)" == "" ]]
} then exit 0; fi
# prompt for gitmoji
exec < /dev/tty
npx --package=gitmoji-cli -- gitmoji --hook \$1 \$2
EOF
chmod a+x "$hook"

Loading

0 comments on commit 9e6c687

Please sign in to comment.