aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IDEAS.md3
-rw-r--r--ISSUES.md2
-rw-r--r--Makefile6
-rw-r--r--VERSION4
-rw-r--r--check/bash.sh14
-rw-r--r--check/bin.sh15
-rw-r--r--check/games.sh5
-rw-r--r--check/ksh.sh11
-rw-r--r--check/sh.sh19
-rw-r--r--check/urxvt.sh4
-rw-r--r--check/xinit.sh9
-rw-r--r--check/zsh.sh12
-rw-r--r--lint/bash.sh10
-rw-r--r--lint/bin.sh20
-rw-r--r--lint/games.sh8
-rw-r--r--lint/ksh.sh9
-rw-r--r--lint/sh.sh14
-rw-r--r--lint/urxvt.sh7
-rw-r--r--lint/vim.sh15
-rw-r--r--lint/xinit.sh6
20 files changed, 138 insertions, 55 deletions
diff --git a/IDEAS.md b/IDEAS.md
index 0a812167..6bb4af82 100644
--- a/IDEAS.md
+++ b/IDEAS.md
@@ -21,3 +21,6 @@ Ideas
calls that via `eval`.
* The BigFileMeasures() function in .vim/config/bigfile.vim should maybe be a
self-contained plugin rather than a config subfile.
+* Ideally, the .awk and/or .sed scripts in the bin and games dirs should be
+ syntax-checked or linted. I could at least add some patient application of
+ appropriate `gawk --lint` calls for each of the .awk scripts.
diff --git a/ISSUES.md b/ISSUES.md
index 48007919..77e0b1d9 100644
--- a/ISSUES.md
+++ b/ISSUES.md
@@ -22,3 +22,5 @@ Known issues
`completion-ignore-case` setting
* Document `install-conf` target once I'm sure it's not a dumb idea
* Need to decide whether I care about XDG, and implement it if I do
+* Need to decide whether I'm testing the shell snippets for MPD, Keychain
+ etc, and if so how.
diff --git a/Makefile b/Makefile
index 314c2a2b..5b316294 100644
--- a/Makefile
+++ b/Makefile
@@ -538,10 +538,10 @@ check: check-bin \
check-bash:
sh check/bash.sh
-check-bin: $(BINS_SH)
+check-bin: $(BINS)
sh check/bin.sh
-check-games:
+check-games: $(GAMES)
sh check/games.sh
check-man:
@@ -556,7 +556,7 @@ check-login-shell:
check-sh:
sh check/sh.sh
-check-urxvt:
+check-urxvt: urxvt/ext/select
sh check/urxvt.sh
check-xinit:
diff --git a/VERSION b/VERSION
index 85545e1d..ce2c4184 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v0.1.0
-Tue Oct 31 06:16:09 UTC 2017
+tejr dotfiles v0.2.0
+Tue Oct 31 10:05:44 UTC 2017
diff --git a/check/bash.sh b/check/bash.sh
index a3efccb1..1f9e1b38 100644
--- a/check/bash.sh
+++ b/check/bash.sh
@@ -1,5 +1,11 @@
-for bash in bash/* bash/bashrc.d/* ; do
- [ -f "$bash" ] || continue
- bash -n "$bash" || exit
+set \
+ bash/bash_completion \
+ bash/bash_completion.d/*.bash \
+ bash/bash_logout \
+ bash/bash_profile \
+ bash/bashrc \
+ bash/bashrc.d/*.bash
+for bash ; do
+ bash -n -- "$bash" || exit
done
-printf 'All bash(1) scripts parsed successfully.\n'
+printf 'GNU Bash dotfiles parsed successfully.\n'
diff --git a/check/bin.sh b/check/bin.sh
index 04b0da6b..08b12778 100644
--- a/check/bin.sh
+++ b/check/bin.sh
@@ -1,4 +1,15 @@
+# POSIX sh
for bin in bin/*.sh ; do
- sh -n "$bin" || exit
+ sh -n -- "${bin%.sh}" || exit
done
-printf 'All shell scripts in bin parsed successfully.\n'
+printf 'POSIX sh binscripts parsed successfully.\n'
+
+# GNU Bash
+if command -v bash >/dev/null 2>&1 ; then
+ for bin in bin/*.bash ; do
+ bash -n -- "${bin%.bash}" || exit
+ done
+ printf 'GNU Bash binscripts parsed successfully.\n'
+else
+ printf 'bash(1) not found, skipping GNU Bash checks.\n'
+fi
diff --git a/check/games.sh b/check/games.sh
index 79d53ed5..cb1bcc31 100644
--- a/check/games.sh
+++ b/check/games.sh
@@ -1,4 +1,5 @@
+# POSIX sh
for game in games/*.sh ; do
- sh -n "$game" || exit
+ sh -n -- "${game%.sh}" || exit
done
-printf 'All shell scripts in games parsed successfully.\n'
+printf 'POSIX sh games parsed successfully.\n'
diff --git a/check/ksh.sh b/check/ksh.sh
index 51e71e19..f4bade82 100644
--- a/check/ksh.sh
+++ b/check/ksh.sh
@@ -1,5 +1,8 @@
-for ksh in ksh/* ksh/kshrc.d/* ; do
- [ -f "$ksh" ] || continue
- ksh -n "$ksh" || exit
+set \
+ ksh/kshrc \
+ ksh/kshrc.d/*.ksh
+for ksh ; do
+ ksh -n -- "$ksh" || exit
done
-printf 'All ksh scripts parsed successfully.\n'
+sh -n -- ksh/shrc.d/ksh.sh || exit
+printf 'Korn shell dotfiles parsed successfully.\n'
diff --git a/check/sh.sh b/check/sh.sh
index c5a86955..92910c11 100644
--- a/check/sh.sh
+++ b/check/sh.sh
@@ -1,11 +1,10 @@
-for sh in \
- sh/* sh/profile.d/* sh/shrc.d/* \
- keychain/profile.d/* keychain/shrc.d/* \
- ksh/shrc.d/* \
- mpd/profile.d/* \
- plenv/profile.d/* plenv/shrc.d/* \
-; do
- [ -f "$sh" ] || continue
- sh -n "$sh" || exit
+set \
+ sh/profile \
+ sh/profile.d/*.sh \
+ sh/shinit \
+ sh/shrc \
+ sh/shrc.d/*.sh
+for sh ; do
+ sh -n -- "$sh" || exit
done
-printf 'All sh(1) scripts parsed successfully.\n'
+printf 'POSIX shell dotfiles parsed successfully.\n'
diff --git a/check/urxvt.sh b/check/urxvt.sh
index ee39e6c9..4a9e7501 100644
--- a/check/urxvt.sh
+++ b/check/urxvt.sh
@@ -1,4 +1,4 @@
for perl in urxvt/ext/*.pl ; do
- perl -c "$perl" || exit
+ perl -c "${perl%.pl}" || exit
done
-printf 'All Perl scripts in urxvt/ext parsed successfully.\n'
+printf 'URxvt Perl extensions parsed successfully.\n'
diff --git a/check/xinit.sh b/check/xinit.sh
index f8116908..fa235c9d 100644
--- a/check/xinit.sh
+++ b/check/xinit.sh
@@ -1,4 +1,7 @@
-for xinit in X/xinitrc X/xinitrc.d/*.sh ; do
- sh -n "$xinit" || exit
+set \
+ X/xinitrc \
+ X/xinitrc.d/*.sh
+for xinit ; do
+ sh -n -- "$xinit" || exit
done
-printf 'X/xinitrc and all shell scripts in X/xinitrc.d parsed successfully.\n'
+printf 'Xinit startup scripts parsed successfully.\n'
diff --git a/check/zsh.sh b/check/zsh.sh
index 50335d56..ce209584 100644
--- a/check/zsh.sh
+++ b/check/zsh.sh
@@ -1,5 +1,9 @@
-for zsh in zsh/* zsh/zshrc.d/* ; do
- [ -f "$zsh" ] || continue
- zsh -n "$zsh" || exit
+set \
+ zsh/zprofile \
+ zsh/zshrc.d/*.zsh \
+ zsh/zshrc
+for zsh ; do
+ zsh -n -- "$zsh" || exit
done
-printf 'All zsh(1) scripts parsed successfully.\n'
+sh -n zsh/profile.d/zsh.sh || exit
+printf 'Z shell dotfiles parsed successfully.\n'
diff --git a/lint/bash.sh b/lint/bash.sh
index 2fe1ba13..6457da35 100644
--- a/lint/bash.sh
+++ b/lint/bash.sh
@@ -1 +1,9 @@
-find bash -type f -print -exec shellcheck -e SC1090 -s bash -- {} +
+set \
+ bash/bash_completion \
+ bash/bash_completion.d/*.bash \
+ bash/bash_logout \
+ bash/bash_profile \
+ bash/bashrc \
+ bash/bashrc.d/*.bash
+shellcheck -e SC1090 -s bash -- "$@" || exit
+printf 'GNU Bash dotfiles linted successfully.\n'
diff --git a/lint/bin.sh b/lint/bin.sh
index 0fe82d7a..6037ca55 100644
--- a/lint/bin.sh
+++ b/lint/bin.sh
@@ -1 +1,19 @@
-find bin -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} +
+# POSIX sh
+set --
+for bin in bin/*.sh ; do
+ set -- "$@" "${bin%.sh}"
+done
+shellcheck -e SC1090 -- "$@" || exit
+printf 'POSIX shell binscripts linted successfully.\n'
+
+# GNU Bash
+if command -v bash >/dev/null 2>&1 ; then
+ set --
+ for bin in bin/*.bash ; do
+ set -- "$@" "${bin%.bash}"
+ done
+ shellcheck -e SC1090 -- "$@" || exit
+ printf 'GNU Bash binscripts linted successfully.\n'
+else
+ printf 'bash(1) not found, skipping GNU Bash lint.\n'
+fi
diff --git a/lint/games.sh b/lint/games.sh
index 6e3e3024..6d51ba0d 100644
--- a/lint/games.sh
+++ b/lint/games.sh
@@ -1 +1,7 @@
-find games -type f -name '*.sh' -print -exec shellcheck -e SC1090 -s sh -- {} +
+# POSIX sh
+set --
+for game in games/*.sh ; do
+ set -- "$@" "${game%.sh}"
+done
+shellcheck -e SC1090 -- "$@" || exit
+printf 'POSIX shell games linted successfully.\n'
diff --git a/lint/ksh.sh b/lint/ksh.sh
index 4cedc6f7..102e0e54 100644
--- a/lint/ksh.sh
+++ b/lint/ksh.sh
@@ -1,3 +1,6 @@
-find ksh \
- -type f -name '*.sh' -exec shellcheck -e SC1090 -s sh -- {} + -o \
- -type f -exec shellcheck -e SC1090 -s ksh -- {} +
+set \
+ ksh/kshrc \
+ ksh/kshrc.d/*.ksh
+shellcheck -e SC1090 -s ksh -- "$@" || exit
+shellcheck -e SC1090 -s sh -- ksh/shrc.d/ksh.sh || exit
+printf 'Korn shell dotfiles linted successfully.\n'
diff --git a/lint/sh.sh b/lint/sh.sh
index 89704c0b..c1c972c8 100644
--- a/lint/sh.sh
+++ b/lint/sh.sh
@@ -1,6 +1,8 @@
-find sh \
- keychain/profile.d keychain/shrc.d \
- ksh/shrc.d \
- mpd/profile.d \
- plenv/profile.d plenv/shrc.d \
- -type f -print -exec shellcheck -e SC1090 -s sh -- {} +
+set \
+ sh/profile \
+ sh/profile.d/*.sh \
+ sh/shinit \
+ sh/shrc \
+ sh/shrc.d/*.sh
+shellcheck -e SC1090 -s sh -- "$@" || exit
+printf 'POSIX shell dotfiles linted successfully.\n'
diff --git a/lint/urxvt.sh b/lint/urxvt.sh
index 507034be..477157f7 100644
--- a/lint/urxvt.sh
+++ b/lint/urxvt.sh
@@ -1 +1,6 @@
-find urxvt/ext -type f ! -name '*.pl' -print -exec perlcritic --brutal -- {} \;
+set --
+for pl in urxvt/ext/*.pl ; do
+ set -- "$@" "${pl%.pl}"
+done
+perlcritic --brutal -- "${pl%.pl}"
+printf 'URxvt Perl extensions linted successfully.\n'
diff --git a/lint/vim.sh b/lint/vim.sh
index 6714ac9a..d876d770 100644
--- a/lint/vim.sh
+++ b/lint/vim.sh
@@ -1,5 +1,10 @@
-for v in vim/* ; do
- [ "$v" != vim/bundle ] || continue
- printf '%s\n' "$v"
- vint -s -- "$v"
-done
+set -- \
+ vim/after \
+ vim/config \
+ vim/ftdetect \
+ vim/ftplugin \
+ vim/gvimrc \
+ vim/indent \
+ vim/vimrc
+vint -s -- "$@" || exit
+printf 'Vim configuration linted successfully.\n'
diff --git a/lint/xinit.sh b/lint/xinit.sh
index b5ff6937..b2718874 100644
--- a/lint/xinit.sh
+++ b/lint/xinit.sh
@@ -1 +1,5 @@
-find X -type f \( -name xinitrc -o -name '*.sh' \) -print -exec shellcheck -e SC1090 -s sh -- {} +
+set \
+ X/xinitrc \
+ X/xinitrc.d/*.sh
+shellcheck -e SC1090 -s sh -- "$@"
+printf 'Xinit startup scripts linted successfully.\n'