iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shellcheck, static usb ethnet addresses, fix vpn config
[distro-setup]
/
brc
diff --git
a/brc
b/brc
index d60af90a674155158c01557efad5eaf143c0c57c..7731b9cdd7c0652302300b7571bb663c4b134726 100644
(file)
--- a/
brc
+++ b/
brc
@@
-2447,20
+2447,14
@@
sk() {
local quotes others ret
quotes=2048,2068,2086,2206,2254
others=2029,2032,2033,2054,2164
local quotes others ret
quotes=2048,2068,2086,2206,2254
others=2029,2032,2033,2054,2164
- # Dont complain about sourced files if we aren't asking for them.
- if [[ $1 != -x ]]; then
- others+=,1091
- fi
- shellcheck -W 999 -e $quotes,$others "$@" || ret=$?
+ shellcheck -x -W 999 -e $quotes,$others "$@" || ret=$?
if (( ret >= 1 )); then
echo "A template comment to disable is now in clipboard. eg: # shellcheck disable=SC2206 # reason"
cbs "# shellcheck disable=SC"
return $ret
fi
}
if (( ret >= 1 )); then
echo "A template comment to disable is now in clipboard. eg: # shellcheck disable=SC2206 # reason"
cbs "# shellcheck disable=SC"
return $ret
fi
}
-skx() {
- sk -x "$@"
-}
+
# sk with quotes. For checking scripts that we expect to take untrusted
# input in order to verify we quoted vars.
skq() {
# sk with quotes. For checking scripts that we expect to take untrusted
# input in order to verify we quoted vars.
skq() {
@@
-2480,49
+2474,24
@@
skmodified() {
}
}
-# sk on all the files in current git repo
(except those excluded)
+# sk on all the files in current git repo
skgit() {
skgit() {
- local f toplevel orig_dir tmp
skip pattern
- local -a ls_files
exclud
es
+ local f toplevel orig_dir tmp
+ local -a ls_files
sk_fil
es
toplevel=$(git rev-parse --show-toplevel)
if [[ $PWD != "$toplevel" ]]; then
orig_dir=$PWD
cd $toplevel
fi
toplevel=$(git rev-parse --show-toplevel)
if [[ $PWD != "$toplevel" ]]; then
orig_dir=$PWD
cd $toplevel
fi
- excludes=(
- 'disabled/*'
- # sourced from brc2
- beet-data
- # sourced from .bash_profile
- .bashrc
- )
- no_check_sourced=(
- .bash_profile
- )
- tmp=$(git ls-files | shuf)
+ # tracked & untracked files
+ tmp=$(git ls-files && git ls-files --others --exclude-standard)
mapfile -t ls_files <<<"$tmp"
for f in "${ls_files[@]}"; do
mapfile -t ls_files <<<"$tmp"
for f in "${ls_files[@]}"; do
- skip=false
- for pattern in "${excludes[@]}"; do
- if [[ $f == $pattern ]]; then
- skip=true
- break
- fi
- done
- if $skip; then continue; fi
-
- check_source=-a
- for pattern in "${no_check_sourced[@]}"; do
- if [[ $f == "$pattern" ]]; then
- check_source=
- break
- fi
- done
if sk-p "$f"; then
if sk-p "$f"; then
- printf "================= %s\n" "$f"
- sk $check_source --color=always $f || [[ $? == 1 ]]
+ sk_files+=("$f")
fi
done
fi
done
+ sk "${sk_files[@]}"
if [[ $orig_dir ]]; then
cd $orig_dir
fi
if [[ $orig_dir ]]; then
cd $orig_dir
fi