diff options
-rw-r--r-- | TODOs.org | 1 | ||||
-rw-r--r-- | bash/agents.sh | 1 | ||||
-rw-r--r-- | bash/aliases.sh | 1 | ||||
-rw-r--r-- | bash/bash_profile.sh | 1 | ||||
-rw-r--r-- | bash/bashrc.sh | 1 | ||||
-rw-r--r-- | bash/facepalm/rotten-apple.sh | 3 | ||||
-rw-r--r-- | default.nix | 30 | ||||
-rw-r--r-- | nixos/utils.nix | 7 |
8 files changed, 20 insertions, 25 deletions
@@ -31,5 +31,6 @@ Add =publishScript= derivation and run it in builds.sr.ht. Profile =bash/bashrc.sh=. ** TODO Improve README.org ** TODO Automate backup.sh +** TODO Remove =shellcheck disable= directives * Nice to have ** TODO Test elfeed diff --git a/bash/agents.sh b/bash/agents.sh index 698d1ac..9a26567 100644 --- a/bash/agents.sh +++ b/bash/agents.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash # shellcheck disable=SC2015 +# shellcheck disable=SC1090 eval "$(thefuck --alias f)" diff --git a/bash/aliases.sh b/bash/aliases.sh index 6a06af9..8e8c3b2 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC2139 unalias -a diff --git a/bash/bash_profile.sh b/bash/bash_profile.sh index 0383eaa..b6e2254 100644 --- a/bash/bash_profile.sh +++ b/bash/bash_profile.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash +# shellcheck disable=SC1090 source ~/dev/libre/dotfiles/bash/bashrc.sh diff --git a/bash/bashrc.sh b/bash/bashrc.sh index fd67d30..f6fae35 100644 --- a/bash/bashrc.sh +++ b/bash/bashrc.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC1090 export DOTFILES=~/dev/libre/dotfiles diff --git a/bash/facepalm/rotten-apple.sh b/bash/facepalm/rotten-apple.sh index 222a2b0..b42bf21 100644 --- a/bash/facepalm/rotten-apple.sh +++ b/bash/facepalm/rotten-apple.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# shellcheck disable=SC1090 +# shellcheck disable=SC1091 +# shellcheck disable=SC2139 isMac && { unalias open diff --git a/default.nix b/default.nix index 268ff9d..7b6e001 100644 --- a/default.nix +++ b/default.nix @@ -1,30 +1,18 @@ let pkgs = import <nixpkgs> { }; rootSrc = pkgs.nix-gitignore.gitignoreSource [ ] ./.; - +in with pkgs; +with pkgs.stdenv; rec { utils = import ./nixos/utils.nix { pkgs = pkgs; rootSrc = rootSrc; # FIXME: remove the need for this baseName = "dotfiles"; }; -in with pkgs; -with pkgs.stdenv; rec { - test = utils.baseTask.overrideAttrs (baseAttrs: rec { - name = "${baseAttrs.name}-test"; - buildInputs = [ - utils.formatNix - # subtasks.shellcheck - # subtasks.fixme - # subtasks.uniqueFeeds - # subtasks.formatNix - ]; - buildPhase = '' - echo "Ran tests for:" - for d in ${builtins.toString buildInputs}; do - echo " $d" - done - echo "All tests passed!" - touch $out - ''; - }); + test = utils.test [ + utils.formatNix + (utils.shellcheck ".*(encrypted|os-installation.sh).*") + # subtasks.fixme + # subtasks.uniqueFeeds + # subtasks.formatNix + ]; } diff --git a/nixos/utils.nix b/nixos/utils.nix index f809dd9..30110a4 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -14,13 +14,12 @@ in rec { exit 1 ''; }; - shellcheck = baseTask.overrideAttrs (baseAttrs: { + shellcheck = ignoredFindPattern: + baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-shellcheck"; buildInputs = baseAttrs.buildInputs ++ [ pkgs.shellcheck ]; buildPhase = '' - export SHELLCHECK_OPTS="-e SC1090 -e SC1091 -e SC2139" - ignored='(encrypted|os-installation.sh|notmuch-post.sh)' - find . -type f -name '*.sh' | grep -E -v $ignored | xargs shellcheck + find . -type f \( -name '*.sh' -and -regextype egrep ! -regex '${ignoredFindPattern}' \) -print0 | xargs -0 shellcheck touch $out ''; }); |