Skip to content

Commit 8e16608

Browse files
authored
Merge pull request #42 from unixorn/add-pre-commit-config
Configure pre-commit
2 parents 241fd25 + 280d256 commit 8e16608

File tree

8 files changed

+38
-10
lines changed

8 files changed

+38
-10
lines changed

.github/workflows/awesomebot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- uses: actions/checkout@v5
1717
- uses: docker://dkhamsing/awesome_bot:latest
1818
with:
19-
args: /github/workspace/README.md --allow-ssl --allow 202,500,501,502,503,504,509,521 --allow-dupe --allow-redirect --request-delay 1 --white-list https://img.shields.io
19+
args: /github/workspace/README.md --allow-ssl --allow 202,500,501,502,503,504,509,521 --allow-dupe --allow-redirect --request-delay 1 --white-list https://img.shields.io

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: check-merge-conflict
7+
- id: check-yaml
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- id: forbid-submodules
11+
- id: mixed-line-ending
12+
- repo: https://github.com/igorshubovych/markdownlint-cli
13+
rev: v0.45.0
14+
hooks:
15+
- id: markdownlint-fix
16+
args: ["--ignore", "LICENSE.md", "--disable", "~MD013"]
17+
- repo: https://github.com/thlorenz/doctoc
18+
rev: v2.2.0
19+
hooks:
20+
- id: doctoc
21+
args: ["--update-only"]

bin/ansi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# © Copyright 2015 Tyler Akins
66
# Licensed under the MIT license with an additional non-advertising clause
77
# See http://github.com/fidian/ansi
8+
# shellcheck disable=SC2004
89

910
add-code() {
1011
local N
@@ -656,4 +657,4 @@ fi
656657

657658
if $NEWLINE; then
658659
echo ""
659-
fi
660+
fi

bin/iterm2-tab-color

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function has() {
2626
}
2727

2828
if [[ ! -n "$ITERM_SESSION_ID" ]]; then
29+
# shellcheck disable=SC2086
2930
fail "$(basename $0) only works in iTerm 2"
3031
fi
3132

@@ -34,5 +35,6 @@ if [[ $# == 3 ]]; then
3435
echo -ne "\033]6;1;bg;green;brightness;$2\a"
3536
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
3637
else
38+
# shellcheck disable=SC2086
3739
fail "$(basename $0) requires 3 arguments for the red, green and blue values to set the tab to"
38-
fi
40+
fi

bin/tab-blue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Set a tab blue
44
#
5-
# Copyright 2022, Joe Block <[email protected]>
5+
# Copyright 2022-2025, Joe Block <[email protected]>
66

77
set -o pipefail
88
if [[ -n "$DEBUG" ]]; then
@@ -30,7 +30,8 @@ if ! has iterm2-tab-color; then
3030
fi
3131

3232
if [[ ! -n "$ITERM_SESSION_ID" ]]; then
33+
# shellcheck disable=SC2086
3334
fail "$(basename $0) only works in iTerm 2"
3435
fi
3536

36-
exec iterm2-tab-color 0 0 255
37+
exec iterm2-tab-color 0 0 255

bin/tab-defaultcolor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
#
55
# Copyright 2022, Joe Block <[email protected]>
66

7-
echo -ne "\033]6;1;bg;*;default\a"
7+
echo -ne "\033]6;1;bg;*;default\a"

bin/tab-green

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Set a tab green
44
#
5-
# Copyright 2022, Joe Block <[email protected]>
5+
# Copyright 2022-2025, Joe Block <[email protected]>
66

77
set -o pipefail
88
if [[ -n "$DEBUG" ]]; then
@@ -30,7 +30,8 @@ if ! has iterm2-tab-color; then
3030
fi
3131

3232
if [[ ! -n "$ITERM_SESSION_ID" ]]; then
33+
# shellcheck disable=SC2086
3334
fail "$(basename $0) only works in iTerm 2"
3435
fi
3536

36-
exec iterm2-tab-color 0 255 0
37+
exec iterm2-tab-color 0 255 0

bin/tab-red

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#
33
# Set a tab red
44
#
5-
# Copyright 2022, Joe Block <[email protected]>
5+
# Copyright 2022-2025, Joe Block <[email protected]>
6+
# shellcheck disable=SC2004
67

78
set -o pipefail
89
if [[ -n "$DEBUG" ]]; then
@@ -30,7 +31,8 @@ if ! has iterm2-tab-color; then
3031
fi
3132

3233
if [[ ! -n "$ITERM_SESSION_ID" ]]; then
34+
# shellcheck disable=SC2086
3335
fail "$(basename $0) only works in iTerm 2"
3436
fi
3537

36-
exec iterm2-tab-color 255 0 0
38+
exec iterm2-tab-color 255 0 0

0 commit comments

Comments
 (0)