Skip to content

Commit 186999a

Browse files
committed
Merge branch 'develop'
2 parents 91cfa2f + 0a36fbe commit 186999a

File tree

8 files changed

+366
-299
lines changed

8 files changed

+366
-299
lines changed

.editorconfig

Lines changed: 256 additions & 257 deletions
Large diffs are not rendered by default.

git/hooks/pre-commit

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@ trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func $
33
set -o errexit
44
set -o errtrace
55

6-
echo "[INFO] pre-commit hook"
7-
86
source ~/properties/git/hooks/.env
97
HOOKS_DIR=$(git rev-parse --git-path hooks)
108
REPO_ROOT=$(git rev-parse --show-toplevel)
11-
echo "[INFO] Environment: ${ENV_NAME}"
12-
echo "[INFO] Git hooks dir: ${HOOKS_DIR}"
13-
echo "[INFO] Repository root: ${REPO_ROOT}"
9+
echo "[pre-commit] [INFO] environment: ${ENV_NAME}"
10+
echo "[pre-commit] [INFO] git hooks dir: ${HOOKS_DIR}"
11+
echo "[pre-commit] [INFO] repository root: ${REPO_ROOT}"
1412

1513
######################################################################
1614

1715
### block specific keywords
1816
BLOCKED_KEYWORDS="$(cat ${HOOKS_DIR}/blocked_keywords.txt)"
1917
for KEYWORD in ${BLOCKED_KEYWORDS}; do
2018
if git diff --cached | grep ${KEYWORD}; then
21-
echo "[ERROR] Commit contains a blocked keyword: ${KEYWORD}"
19+
echo "[pre-commit] [ERROR] Commit contains a blocked keyword: ${KEYWORD}"
2220
exit 1
2321
fi
2422
done
@@ -27,33 +25,31 @@ done
2725

2826
### signing commits
2927

30-
CURRENT_USER_NAME="$(git config user.name)"
31-
CURRENT_USER_EMAIL="$(git config user.email)"
32-
CURRENT_GPG_SIGNING_KEY="$(git config user.signingkey)"
28+
GPG_SIGNING_KEY="$(git config user.signingkey)"
3329

3430
### check if the current gpg signing key exists
35-
if [ -z "${CURRENT_GPG_SIGNING_KEY}" ]; then
36-
echo "[ERROR] No GPG key set for signing commits."
31+
echo "[pre-commit] [INFO] Current GPG signing key: ${GPG_SIGNING_KEY}"
32+
if [ -z "${GPG_SIGNING_KEY}" ]; then
33+
echo "[pre-commit] [ERROR] No GPG key set for signing commits."
3734
exit 1
3835
fi
39-
echo "[pre-commit] [INFO] Current GPG signing key: ${CURRENT_GPG_SIGNING_KEY}"
4036

4137
### check if the current user name and email match the env config
42-
if [ "${CURRENT_USER_NAME}" != "${ENV_USER_NAME}" ] ||
43-
[ "${CURRENT_USER_EMAIL}" != "${ENV_USER_EMAIL}" ]; then
44-
echo "[ERROR] Commit rejected. Your user name or email is incorrect."
38+
echo "[pre-commit] [INFO] Current user name: ${GIT_AUTHOR_NAME}"
39+
echo "[pre-commit] [INFO] Current user email: ${GIT_AUTHOR_EMAIL}"
40+
if [ "${GIT_AUTHOR_NAME}" != "${ENV_USER_NAME}" ] ||
41+
[ "${GIT_AUTHOR_EMAIL}" != "${ENV_USER_EMAIL}" ]; then
42+
echo "[pre-commit] [ERROR] Commit rejected. Your user name or email is incorrect."
4543
exit 1
4644
fi
47-
echo "[pre-commit] [INFO] Current user name: ${CURRENT_USER_NAME}"
48-
echo "[pre-commit] [INFO] Current user email: ${CURRENT_USER_EMAIL}"
4945

5046
### check if the current gpg signing key matches the env config
5147
GPG_USER_INFO="$(gpg --list-keys --with-colons "${ENV_GPG_SIGNING_KEY}" | grep "^uid:" | head -n 1 | cut -d: -f10)"
5248
GPG_USER_NAME="${GPG_USER_INFO% <*}"
5349
GPG_USER_EMAIL="${GPG_USER_INFO#*<}" && GPG_USER_EMAIL="${GPG_USER_EMAIL%>}"
54-
if [ "${CURRENT_USER_NAME}" != "${GPG_USER_NAME}" ] ||
55-
[ "${CURRENT_USER_EMAIL}" != "${GPG_USER_EMAIL}" ]; then
56-
echo "[ERROR] Git config user name or email doesn't match the GPG key's user name or email."
50+
if [ "${GIT_AUTHOR_NAME}" != "${GPG_USER_NAME}" ] ||
51+
[ "${GIT_AUTHOR_EMAIL}" != "${GPG_USER_EMAIL}" ]; then
52+
echo "[pre-commit] [ERROR] Git config user name or email doesn't match the GPG key's user name or email."
5753
exit 1
5854
fi
5955
echo "[pre-commit] [INFO] GPG signing key matches the environment config."

git/hooks/pre-push

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func $
33
set -o errexit
44
set -o errtrace
55

6-
echo "[INFO] pre-push hook"
7-
86
source ~/properties/git/hooks/.env
97
HOOKS_DIR=$(git rev-parse --git-path hooks)
108
REPO_ROOT=$(git rev-parse --show-toplevel)
11-
echo "[INFO] Environment: ${ENV_NAME}"
12-
echo "[INFO] Git hooks dir: ${HOOKS_DIR}"
13-
echo "[INFO] Repository root: ${REPO_ROOT}"
9+
echo "[pre-push] [INFO] environment: ${ENV_NAME}"
10+
echo "[pre-push] [INFO] git hooks dir: ${HOOKS_DIR}"
11+
echo "[pre-push] [INFO] repository root: ${REPO_ROOT}"
1412

1513
######################################################################
1614

@@ -22,7 +20,7 @@ if [ -z "$(git ls-remote --heads origin)" ]; then
2220
else
2321
COMMITS_TO_PUSH="$(git log @{u}.. --pretty=format:"%H")"
2422
fi
25-
echo "[INFO] Commits to push:"
23+
echo "[pre-push] [INFO] Commits to push:"
2624
echo "${COMMITS_TO_PUSH}"
2725

2826
######################################################################
@@ -40,7 +38,7 @@ for COMMIT in ${COMMITS_TO_PUSH}; do
4038
COMMIT_USER_EMAIL="$(git show -s --pretty=format:%aE ${COMMIT})"
4139
if [ "${COMMIT_USER_NAME}" != "${ENV_USER_NAME}" ] ||
4240
[ "${COMMIT_USER_EMAIL}" != "${ENV_USER_EMAIL}" ]; then
43-
echo "[ERROR] Push rejected. Your user name or email is incorrect."
41+
echo "[pre-push] [ERROR] Push rejected. Your user name or email is incorrect."
4442
exit 1
4543
fi
4644

@@ -50,14 +48,16 @@ for COMMIT in ${COMMITS_TO_PUSH}; do
5048
COMMIT_GPG_USER_NAME="${COMMIT_GPG_USER_INFO% <*}"
5149
COMMIT_GPG_USER_EMAIL="${COMMIT_GPG_USER_INFO#*<}" && COMMIT_GPG_USER_EMAIL="${COMMIT_GPG_USER_EMAIL%>}"
5250
if [ "${COMMIT_GPG_SIGNING_KEY}" != "${ENV_GPG_SIGNING_KEY}" ]; then
53-
echo "[ERROR] Commit ${COMMIT} is signed with a different GPG key."
51+
echo "[pre-push] [ERROR] Commit ${COMMIT} is signed with a different GPG key."
5452
exit 1
5553
fi
5654
if [ "${COMMIT_GPG_USER_NAME}" != "${ENV_USER_NAME}" ] ||
5755
[ "${COMMIT_GPG_USER_EMAIL}" != "${ENV_USER_EMAIL}" ]; then
58-
echo "[ERROR] Push rejected. Your GPG user name or email is incorrect."
56+
echo "[pre-push] [ERROR] Push rejected. Your GPG user name or email is incorrect."
5957
exit 1
6058
fi
6159
done
6260

61+
######################################################################
62+
6363
exit 0

git/hooks/prepare-commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ if echo "${COMMIT_MESSAGE}" | grep -q -E "\s{2,}"; then
4747
exit 1
4848
fi
4949

50+
######################################################################
51+
5052
exit 0
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import io.gitlab.arturbosch.detekt.Detekt
2+
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
3+
4+
plugins {
5+
...
6+
id("io.gitlab.arturbosch.detekt") version "1.23.8"
7+
}
8+
9+
// ...
10+
11+
dependencies {
12+
// ...
13+
14+
implementation("io.gitlab.arturbosch.detekt:detekt-api:1.23.8")
15+
implementation("io.gitlab.arturbosch.detekt:detekt-core:1.23.8")
16+
detektPlugins(sourceSets.main.get().output)
17+
}
18+
19+
detekt {
20+
buildUponDefaultConfig = true
21+
allRules = false
22+
config.setFrom("$projectDir/ci/detekt/detekt.yaml")
23+
baseline = file("$projectDir/ci/detekt/baseline.xml")
24+
}
25+
26+
configurations.all {
27+
resolutionStrategy.eachDependency {
28+
if (requested.group == "org.jetbrains.kotlin") {
29+
useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion())
30+
}
31+
}
32+
}
33+
34+
tasks.withType<Detekt>().configureEach {
35+
reports {
36+
html.required.set(true)
37+
xml.required.set(true)
38+
sarif.required.set(true)
39+
md.required.set(true)
40+
}
41+
}
42+
43+
tasks.withType<Detekt>() {
44+
jvmTarget = "21"
45+
}
46+
tasks.withType<DetektCreateBaselineTask>() {
47+
jvmTarget = "21"
48+
}

linux/atuin/atuin-commands.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
11
######################################################################
22

3+
atuin --help
4+
atuin --version
5+
6+
atuin info
7+
8+
######################################################################
9+
10+
### statistics
11+
atuin stats
12+
13+
### history
14+
atuin search curl
15+
16+
######################################################################
17+
318
### delete all history
419
atuin search --delete-it-all
5-
atuin search --delete-it-all --exclude-exit 0
20+
atuin search --delete-it-all --exclude-exit=0
621

722
### delete history with filter
8-
atuin search --delete --exclude-exit 0 docker
23+
atuin search --delete --exclude-exit=0 docker
24+
atuin search --delete --exclude-exit=0 curl
25+
atuin search --delete hostctl
26+

macos/hostctl/hostctl-commands.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### install hostctl
44
brew install guumaster/tap/hostctl
55

6+
hostctl --help
7+
68
######################################################################
79

810
hostctl list
@@ -14,7 +16,13 @@ hostctl list
1416
### | default | on | ::1 | localhost |
1517
### +---------+--------+-----------------+---------------------+
1618

19+
hostctl status
20+
1721
######################################################################
1822

1923
sudo hostctl add k8s < k8s.hosts
2024
sudo hostctl replace k8s < k8s.hosts
25+
sudo hostctl remove k8s
26+
27+
sudo hostctl enable work
28+
sudo hostctl disable work

macos/hostctl/k8s.hosts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,11 @@
2222
192.168.0.50 vault.example.com
2323
192.168.0.50 vault.example.com
2424

25-
192.168.0.50 catalog-command.example.com
26-
192.168.0.50 catalog-query.example.com
27-
192.168.0.50 customer-command.example.com
28-
192.168.0.50 customer-query.example.com
29-
192.168.0.50 inventory-command.example.com
30-
192.168.0.50 inventory-query.example.com
25+
192.168.0.50 catalog.example.com
26+
192.168.0.50 customer.example.com
27+
192.168.0.50 delivery.example.com
3128
192.168.0.50 identity.example.com
32-
192.168.0.50 order-command.example.com
33-
192.168.0.50 order-query.example.com
34-
192.168.0.50 payment-command.example.com
35-
192.168.0.50 payment-query.example.com
36-
29+
192.168.0.50 inventory.example.com
30+
192.168.0.50 notification.example.com
31+
192.168.0.50 order.example.com
32+
192.168.0.50 payment.example.com

0 commit comments

Comments
 (0)