Skip to content

Commit

Permalink
Merge pull request #12 from mineiros-io/align-with-sc2155
Browse files Browse the repository at this point in the history
align with SC2155 and declare local variables first before setting va…
  • Loading branch information
mariux authored May 27, 2020
2 parents 5103816 + 43c3325 commit ce4373c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pre_commit_hooks/make/phony-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ EXITCODE=0

validate_phony_targets() {
local file=$1
local source=$(make -npq -f "${file}" | grep -E '^.PHONY:')
local targets=$(sed -n 's#^.PHONY:\(.*\)#\1#p' <<< "${source}")
local source
local targets

source=$(make -npq -f "${file}" | grep -E '^.PHONY:')
targets=$(sed -n 's#^.PHONY:\(.*\)#\1#p' <<<"${source}")

for target in $targets; do
# The q command for setting exit codes if a pattern doesn't match,
Expand Down

0 comments on commit ce4373c

Please sign in to comment.