Skip to content

Commit 7f3c7b7

Browse files
committed
feat: prettier-plugin-sh + tweaks and codefixes
1 parent fc16b82 commit 7f3c7b7

15 files changed

+71
-38
lines changed

.browserslistrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
extends @ivuorinen/browserslist-config
1+
extends @ivuorinen/browserslist-config

.editorconfig

+6
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ space_redirects = true
2727
keep_padding = false
2828
function_next_line = true # --func-next-line
2929

30+
# Ignore the entire "third_party" directory when calling shfmt on directories,
31+
# such as "shfmt -l -w .". When formatting files directly,
32+
# like "shfmt -w third_party/foo.sh" or "shfmt --filename=third_party/foo.sh",
33+
# the ignore logic is applied only when the --apply-ignore flag is given.
34+
[{tools/**,local/bin/asdf/**,config/cheat/cheatsheets/**}]
35+
ignore = true

.prettierignore

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
.mypy_cache/*
2-
tools/dotbot*
3-
local/bin/antigen.zsh
2+
Brewfile.lock.json
43
config/cheat/cheatsheets/community
4+
config/cheat/cheatsheets/tldr
5+
config/fzf/*
6+
config/nvim-kickstart/*
57
config/tmux/plugins/*
8+
config/zsh/*
69
lazy-lock.json
7-
Brewfile.lock.json
8-
10+
local/bin/antigen.zsh
11+
local/bin/asdf
12+
tools/dotbot*

.prettierrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
plugins: ['prettier-plugin-sh'],
23
...require('@ivuorinen/prettier-config'),
34
trailingComma: 'all',
45
// Add custom options below:

base/zshenv

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ export XDG_BIN_HOME="$HOME/.local/bin"
1616
export XDG_CACHE_HOME="$HOME/.cache"
1717
export XDG_RUNTIME_DIR="$HOME/.local/run"
1818

19-
source "$DOTFILES/config/exports"
20-
source "$DOTFILES/config/alias"
21-
19+
source "$DOTFILES/config/shared"

base/zshrc

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ x-have pyenv && {
7878
# Autoupdate tmux window name
7979
TMUX_WINDOW_NAME_PLUGIN="$DOTFILES/config/tmux/plugins/tmux-window-name/scripts/rename_session_windows.py"
8080
[ -f "$TMUX_WINDOW_NAME_PLUGIN" ] && {
81-
tmux-window-name()
81+
tmux_window_name()
8282
{
8383
($TMUX_WINDOW_NAME_PLUGIN &)
8484
}
85-
add-zsh-hook chpwd tmux-window-name
86-
tmux-window-name
85+
add-zsh-hook chpwd tmux_window_name
86+
tmux_window_name
8787
}
8888
}
8989

@@ -95,8 +95,8 @@ source "$DOTFILES/config/alias"
9595

9696
# Herd checks for a few environment variables to inject PHP binaries and configurations.
9797
# Herd injected PHP binary.
98-
# export PATH="/Users/ivuorinen/Library/Application Support/Herd/bin/":$PATH
98+
# export PATH="/Users/ivuorinen/Library/Application\ Support/Herd/bin/":$PATH
9999
# Herd injected PHP 8.3 configuration.
100-
# export HERD_PHP_83_INI_SCAN_DIR="/Users/ivuorinen/Library/Application Support/Herd/config/php/83/"
100+
# export HERD_PHP_83_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/83/"
101101
# Herd injected PHP 7.4 configuration.
102-
# export HERD_PHP_74_INI_SCAN_DIR="/Users/ivuorinen/Library/Application Support/Herd/config/php/74/"
102+
# export HERD_PHP_74_INI_SCAN_DIR="/Users/ivuorinen/Library/Application\ Support/Herd/config/php/74/"

config/asdf/asdfrc

-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
legacy_version_file=yes
44
use_release_candidates=no
5-
plugin_repository_last_check_duration=60
6-
disable_plugin_short_name_repository=no
75
concurrency=auto

config/exports

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ have()
3737
# function to run dark-notify and change alacritty theme
3838
# it uses flock to prevent running multiple instances
3939
# install flock with `brew install flock` on macOS
40-
function darknotify-alacritty {
40+
function darknotify-alacritty
41+
{
4142
have flock && [[ -f /tmp/dark-notify-alacritty.lock ]] && return
4243
have dark-notify && {
4344
# true is used to prevent the command show it was backgrounded
44-
true & flock /tmp/dark-notify-alacritty.lock dark-notify -c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
45+
true \
46+
&& flock /tmp/dark-notify-alacritty.lock dark-notify -c "$HOME/.dotfiles/local/bin/x-change-alacritty-theme" &
4547
}
48+
49+
return 0
4650
}
4751
darknotify-alacritty
4852

config/exports-apps

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ export GOBIN="$XDG_BIN_HOME"
6969

7070
# Herd, herd.laravel.com
7171
# Herd injected PHP binary.
72-
export PATH="$HOME/Library/Application Support/Herd/bin/":$PATH
72+
export PATH="$HOME/Library/Application\ Support/Herd/bin/":$PATH
7373

7474
x-have herd && {
7575
# Herd injected PHP 8.3 configuration.
76-
export HERD_PHP_83_INI_SCAN_DIR="$HOME/Library/Application Support/Herd/config/php/83/"
76+
export HERD_PHP_83_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/83/"
7777
# Herd injected PHP 7.4 configuration.
78-
export HERD_PHP_74_INI_SCAN_DIR="$HOME/Library/Application Support/Herd/config/php/74/"
78+
export HERD_PHP_74_INI_SCAN_DIR="$HOME/Library/Application\ Support/Herd/config/php/74/"
7979
}
8080

8181
# nb, https://xwmx.github.io/nb/

config/nvim/lazyvim.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
"NEWS.md": "6077"
3333
},
3434
"version": 6
35-
}
35+
}

config/omp/own.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@
111111
{
112112
"background": "transparent",
113113
"foreground": "lightGreen",
114-
"foreground_templates": [
115-
"{{ if gt .Code 0 }}red{{ end }}"
116-
],
114+
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
117115
"properties": {
118116
"always_enabled": true
119117
},
@@ -128,9 +126,7 @@
128126
"transient_prompt": {
129127
"background": "transparent",
130128
"foreground": "lightGreen",
131-
"foreground_templates": [
132-
"{{ if gt .Code 0 }}red{{ end }}"
133-
],
129+
"foreground_templates": ["{{ if gt .Code 0 }}red{{ end }}"],
134130
"template": "\u279c "
135131
},
136132
"version": 2

local/bin/x-load-configs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# Load our configuration files
33
# Copyright (c) 2023 Ismo Vuorinen. All Rights Reserved.
44

5-
set -euo pipefail
6-
7-
# Set verbosity with VERBOSE=1 x-load-configs
5+
# Enable verbosity with VERBOSE=1 x-load-configs
86
VERBOSE="${VERBOSE:=0}"
7+
# Enable debugging with DEBUG=1 x-load-configs
8+
DEBUG="${DEBUG:=0}"
99

10-
[ "$VERBOSE" = "1" ] && {
10+
[ "$DEBUG" = "1" ] && {
1111
set -x
1212
}
1313

@@ -37,7 +37,7 @@ loadConfigFiles()
3737
HOST_FILE=$CONFIG_FILE-$HOST
3838
SECRET_HOST=$HOST_FILE-secret
3939

40-
[ "$VERBOSE" = "1" ] && configMsg "?" "$CONFIG_FILE"
40+
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$CONFIG_FILE"
4141

4242
# global (exports|alias|functions) FILENAME for all hosts
4343
# shellcheck source=../config/exports
@@ -47,19 +47,19 @@ loadConfigFiles()
4747

4848
# global secret FILENAME, git ignored
4949
# shellcheck source=../config/exports-secret
50-
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_FILE"
50+
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$SECRET_FILE"
5151
[ -r "$SECRET_FILE" ] && {
5252
source "$SECRET_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_FILE"
5353
}
5454
# host specific (exports|alias|functions) FILENAME
5555
# shellcheck source=../config/exports
56-
[ "$VERBOSE" = "1" ] && configMsg "?" "$HOST_FILE"
56+
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$HOST_FILE"
5757
[ -r "$HOST_FILE" ] && {
5858
source "$HOST_FILE" && [ "$VERBOSE" = "1" ] && configMsg "Found" "$HOST_FILE"
5959
}
6060
# host specific (exports|alias|functions) FILENAME, git ignored
6161
# shellcheck source=../config/exports
62-
[ "$VERBOSE" = "1" ] && configMsg "?" "$SECRET_HOST"
62+
[ "$VERBOSE" = "1" ] && configMsg "Looking for" "$SECRET_HOST"
6363
[ -r "$SECRET_HOST" ] && {
6464
source "$SECRET_HOST" \
6565
&& [ "$VERBOSE" = "1" ] && configMsg "Found" "$SECRET_HOST"

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
},
2929
"homepage": "https://github.com/ivuorinen/dotfiles#readme",
3030
"devDependencies": {
31-
"@ivuorinen/base-configs": "^1.1.0"
31+
"@ivuorinen/base-configs": "^1.1.0",
32+
"prettier-plugin-sh": "^0.14.0"
3233
},
3334
"packageManager": "[email protected]"
3435
}

scripts/install-go-packages.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ x-have git-profile && {
5353

5454
x-have antidot && {
5555
antidot update \
56-
&& msg_ok "Updated antidot database"
56+
&& msg_ok "Updated antidot database"
5757
}
5858

5959
echo ""

yarn.lock

+25
Original file line numberDiff line numberDiff line change
@@ -3418,6 +3418,11 @@ mute-stream@^1.0.0:
34183418
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-1.0.0.tgz#e31bd9fe62f0aed23520aa4324ea6671531e013e"
34193419
integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==
34203420

3421+
mvdan-sh@^0.10.1:
3422+
version "0.10.1"
3423+
resolved "https://registry.yarnpkg.com/mvdan-sh/-/mvdan-sh-0.10.1.tgz#5b3a4462a89cf20739b12d851589342c875f4d1f"
3424+
integrity sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==
3425+
34213426
mz@^2.4.0:
34223427
version "2.7.0"
34233428
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
@@ -4008,6 +4013,14 @@ prelude-ls@^1.2.1:
40084013
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
40094014
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
40104015

4016+
prettier-plugin-sh@^0.14.0:
4017+
version "0.14.0"
4018+
resolved "https://registry.yarnpkg.com/prettier-plugin-sh/-/prettier-plugin-sh-0.14.0.tgz#22b186adea79b36212ccd9faa8dd01f33ef34ff6"
4019+
integrity sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==
4020+
dependencies:
4021+
mvdan-sh "^0.10.1"
4022+
sh-syntax "^0.4.1"
4023+
40114024
40124025
version "3.3.2"
40134026
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.3.2.tgz#03ff86dc7c835f2d2559ee76876a3914cec4a90a"
@@ -4353,6 +4366,13 @@ set-function-name@^2.0.1:
43534366
functions-have-names "^1.2.3"
43544367
has-property-descriptors "^1.0.2"
43554368

4369+
sh-syntax@^0.4.1:
4370+
version "0.4.2"
4371+
resolved "https://registry.yarnpkg.com/sh-syntax/-/sh-syntax-0.4.2.tgz#3bad5c6134b510e7b4c53b16f409ce4fd2a65245"
4372+
integrity sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==
4373+
dependencies:
4374+
tslib "^2.6.2"
4375+
43564376
shebang-command@^2.0.0:
43574377
version "2.0.0"
43584378
resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
@@ -4796,6 +4816,11 @@ tsconfig-paths@^3.15.0:
47964816
minimist "^1.2.6"
47974817
strip-bom "^3.0.0"
47984818

4819+
tslib@^2.6.2:
4820+
version "2.6.3"
4821+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
4822+
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
4823+
47994824
tuf-js@^2.2.1:
48004825
version "2.2.1"
48014826
resolved "https://registry.yarnpkg.com/tuf-js/-/tuf-js-2.2.1.tgz#fdd8794b644af1a75c7aaa2b197ddffeb2911b56"

0 commit comments

Comments
 (0)