Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShellCheck report #1

Open
devdrops opened this issue Apr 11, 2016 · 2 comments
Open

ShellCheck report #1

devdrops opened this issue Apr 11, 2016 · 2 comments

Comments

@devdrops
Copy link
Owner

devdrops commented Apr 11, 2016

From http://www.shellcheck.net/:

$ shellcheck myscript

Line 25:
CONFIG_FILE=$(dirname $0)/config
                      ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 26:
if [ -e $CONFIG_FILE ]; then
        ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 27:
    . $CONFIG_FILE
    ^-- SC1090: Can't follow non-constant source. Use a directive to specify location.
      ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 93:
    SNIFFS=""
    ^-- SC2034: SNIFFS appears unused. Verify it or export it.

Line 139:
  ID=$(git diff-index --cached $against $FILE | cut -d " " -f4)
                                        ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 143:
  mkdir -p "$TMP_STAGING/$(dirname $FILE)"
                                   ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 144:
  git cat-file blob $ID > "$TMP_STAGING/$FILE"
                    ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 150:
PHPCS_OUTPUT=$($PHPCS_BIN -s $IGNORE_WARNINGS --standard=$PHPCS_CODING_STANDARD $ENCODING $IGNORE $STAGED_FILES)
                                                                                                  ^-- SC2086: Double quote to prevent globbing and word splitting.

Line 167:
PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES $PHPMD_OUTPUT $PHPMD_PATTERNS_LIST $PHPMD_SUFFIXES_LIST $PHPMD_EXCLUDE_LIST)
                          ^-- SC2086: Double quote to prevent globbing and word splitting.
@devdrops
Copy link
Owner Author

devdrops commented May 2, 2016

Also check https://github.com/koalaman/shellcheck/wiki to understand each point 😉.

@devdrops
Copy link
Owner Author

devdrops commented Sep 9, 2016

Update:

In pre-commit line 40:
CONFIG_FILE=$(dirname $0)/config
                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 41:
if [ -e $CONFIG_FILE ]; then
        ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 42:
    . $CONFIG_FILE
    ^-- SC1090: Can't follow non-constant source. Use a directive to specify location.
      ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 129:
    SNIFFS=""
    ^-- SC2034: SNIFFS appears unused. Verify it or export it.


In pre-commit line 185:
    ID=$(git diff-index --cached $against $FILE | cut -d " " -f4)
                                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 190:
    mkdir -p "$TMP_STAGING/$(dirname $FILE)"
                                     ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 191:
    git cat-file blob $ID > "$TMP_STAGING/$FILE"
                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 202:
    PHPCS_OUTPUT=$($PHPCS_BIN -s $IGNORE_WARNINGS $PHPCS_CODING_STANDARD $ENCODING $IGNORE $STAGED_FILES)
                                                                                           ^-- SC2086: Double quote to prevent globbing and word splitting.


In pre-commit line 227:
    PHPMD_OUTPUT=$($PHPMD_BIN $STAGED_FILES $PHPMD_OUTPUT $PHPMD_PATTERNS_LIST $PHPMD_SUFFIXES_LIST $PHPMD_EXCLUDE_LIST)
                              ^-- SC2086: Double quote to prevent globbing and word splitting. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant