+
+# sk on all the files in current git repo (except those excluded)
+skgit() {
+ local f toplevel orig_dir tmp skip pattern
+ local -a ls_files excludes
+ 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)
+ 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
+ printf "================= %s\n" "$f"
+ sk $check_source --color=always $f || [[ $? == 1 ]]
+ fi
+ done
+ if [[ $orig_dir ]]; then
+ cd $orig_dir
+ fi
+}
+
+