i think this fixes i3 issues
[distro-setup] / shellcheck-this-repo
1 #!/bin/bash
2
3 this_file="$(readlink -f -- "${BASH_SOURCE[0]}")"
4 readonly this_file this_dir="${this_file%/*}"
5 cd "$this_dir"
6
7 . .bashrc
8
9 # "a", as in, pass to sk -a
10 a_files=(
11 brc2
12 install-my-scripts
13 )
14
15 a_sourced_files=(
16 script-files
17 beet-data
18 )
19
20 declare -a ls_files standard_files
21
22 # so, shellcheck doesn't like files that declare variables that are just
23 # used in other files that source them. Using -a like this is the only
24 # way to solve it. We can't just -a on everything because then we would
25 # get various files I didn't write and that don't pass shellcheck.
26 sk -a ${a_files[@]}
27
28
29 tmp=$(git ls-files && git ls-files --others --exclude-standard)
30 mapfile -t ls_files <<<"$tmp"
31 for f in "${ls_files[@]}"; do
32 skip=false
33 for fignore in ${a_files[@]} ${a_sourced_files[@]}; do
34 if [[ $f == "$fignore" ]]; then
35 skip=true
36 break
37 fi
38 done
39 if $skip; then continue; fi
40 if sk-p "$f"; then
41 standard_files+=("$f")
42 fi
43 done
44
45 sk "${standard_files[@]}"