Can't follow non-constant source. Use a directive to specify location. Open
. "$HOME/.mavenrc"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Can't follow non-constant source. Use a directive to specify location.
Problematic code:
. "$(find_install_dir)/lib.sh"
Correct code:
# shellcheck source=src/lib.sh
. "$(find_install_dir)/lib.sh"
Rationale:
ShellCheck is not able to include sourced files from paths that are determined at runtime. The file will not be read, potentially resulting in warnings about unassigned variables and similar.
Use a [[Directive]] to point shellcheck to a fixed location it can read instead.
Exceptions:
If you don't care that ShellCheck is unable to account for the file, specify # shellcheck source=/dev/null
.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
This directive is unknown. It will be ignored. Open
# shellcheck disable=SC2086 # safe args
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This directive is unknown. It will be ignored.
Problematic code:
# shellcheck foobar=baz
echo "Hello World"
Correct code:
Depends on your intention.
Rationale:
ShellCheck doesn't recognize the [[directive]] you're trying to use in a # shellcheck
comment. See the [[Directive]]s page for supported directives.
It could be misspelled, or you could be using an older version of shellcheck that doesn't support it yet.
Exceptions:
None. If you wish to ignore this warning and continue without it, you need version 0.4.5 (commit 88c56ec) or later and a command grouping:
# Ignore an unrecognized directive in 0.4.5 or later:
# shellcheck disable=SC1107
{
# shellcheck unrecognized=directive
echo "Hello World"
}
Before 0.4.5, unrecognized directives are considered parse errors.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
This \u will be a regular 'u' in this context. Open
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This \o
will be a regular 'o' in this context.
Problematic code:
# Want literal backslash
echo Yay \o/
# Want linefeed
greeting=Hello\nWorld
# Want other characters
carriagereturn=\r
Correct code:
echo 'Yay \o/'
greeting='Hello
World'
carriagereturn=$(printf '\r')
Rationale:
You have escaped something that has no special meaning when escaped. The backslash will be simply be ignored.
If the backslash was supposed to be literal, single quote or escape it.
If you wanted it to expand to something, rewrite the expression. For linefeeds (\n
), put them literally in quotes. For other characters, use POSIX printf
or bash/ksh $'...'
.
Exceptions
None. ShellCheck (as of 2017-07-03, commit 31bb02d6) will not warn when the first letter of a command is unnecessarily escaped, as this is frequently used to suppress aliases interactively.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
This directive is unknown. It will be ignored. Open
# shellcheck disable=SC2086 # safe args
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This directive is unknown. It will be ignored.
Problematic code:
# shellcheck foobar=baz
echo "Hello World"
Correct code:
Depends on your intention.
Rationale:
ShellCheck doesn't recognize the [[directive]] you're trying to use in a # shellcheck
comment. See the [[Directive]]s page for supported directives.
It could be misspelled, or you could be using an older version of shellcheck that doesn't support it yet.
Exceptions:
None. If you wish to ignore this warning and continue without it, you need version 0.4.5 (commit 88c56ec) or later and a command grouping:
# Ignore an unrecognized directive in 0.4.5 or later:
# shellcheck disable=SC1107
{
# shellcheck unrecognized=directive
echo "Hello World"
}
Before 0.4.5, unrecognized directives are considered parse errors.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
This directive is unknown. It will be ignored. Open
# shellcheck disable=SC2086 # safe args
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This directive is unknown. It will be ignored.
Problematic code:
# shellcheck foobar=baz
echo "Hello World"
Correct code:
Depends on your intention.
Rationale:
ShellCheck doesn't recognize the [[directive]] you're trying to use in a # shellcheck
comment. See the [[Directive]]s page for supported directives.
It could be misspelled, or you could be using an older version of shellcheck that doesn't support it yet.
Exceptions:
None. If you wish to ignore this warning and continue without it, you need version 0.4.5 (commit 88c56ec) or later and a command grouping:
# Ignore an unrecognized directive in 0.4.5 or later:
# shellcheck disable=SC1107
{
# shellcheck unrecognized=directive
echo "Hello World"
}
Before 0.4.5, unrecognized directives are considered parse errors.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
Not following: /usr/local/etc/mavenrc: openFile: does not exist (No such file or directory) Open
. /usr/local/etc/mavenrc
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Not following: (error message here)
Reasons include: file not found, no permissions, not included on the command line, not allowing shellcheck
to follow files with -x
, etc.
Problematic code:
source somefile
Correct code:
# shellcheck disable=SC1091
source somefile
Rationale:
ShellCheck, for whichever reason, is not able to access the source file.
This could be because you did not include it on the command line, did not use shellcheck -x
to allow following other files, don't have permissions or a variety of other problems.
Feel free to ignore the error with a [[directive]].
Exceptions:
If you're fine with it, ignore the message with a [[directive]].
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
This \c will be a regular 'c' in this context. Open
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
This \o
will be a regular 'o' in this context.
Problematic code:
# Want literal backslash
echo Yay \o/
# Want linefeed
greeting=Hello\nWorld
# Want other characters
carriagereturn=\r
Correct code:
echo 'Yay \o/'
greeting='Hello
World'
carriagereturn=$(printf '\r')
Rationale:
You have escaped something that has no special meaning when escaped. The backslash will be simply be ignored.
If the backslash was supposed to be literal, single quote or escape it.
If you wanted it to expand to something, rewrite the expression. For linefeeds (\n
), put them literally in quotes. For other characters, use POSIX printf
or bash/ksh $'...'
.
Exceptions
None. ShellCheck (as of 2017-07-03, commit 31bb02d6) will not warn when the first letter of a command is unnecessarily escaped, as this is frequently used to suppress aliases interactively.
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
Not following: /etc/mavenrc: openFile: does not exist (No such file or directory) Open
. /etc/mavenrc
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Not following: (error message here)
Reasons include: file not found, no permissions, not included on the command line, not allowing shellcheck
to follow files with -x
, etc.
Problematic code:
source somefile
Correct code:
# shellcheck disable=SC1091
source somefile
Rationale:
ShellCheck, for whichever reason, is not able to access the source file.
This could be because you did not include it on the command line, did not use shellcheck -x
to allow following other files, don't have permissions or a variety of other problems.
Feel free to ignore the error with a [[directive]].
Exceptions:
If you're fine with it, ignore the message with a [[directive]].
Notice
Original content from the ShellCheck https://github.com/koalaman/shellcheck/wiki.
Expected an indentation at 4 instead of at 2. Open
if [ -f "$HOME/.mavenrc" ] ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
MINGW*) mingw=true;;
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
if $darwin ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
echo " We cannot execute $JAVACMD" >&2
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
break
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
CYGWIN*) cygwin=true ;;
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$JAVA_HOME" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
JAVA_HOME="$javaHome"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ "$MVNW_VERBOSE" = true ]; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
exit 1;
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
safeValue=$(echo "$value" | tr -d '\r')
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if command -v sha256sum > /dev/null; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
while [ "$wdir" != '/' ] ; do
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
$MAVEN_DEBUG_OPTS \
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -f /usr/local/etc/mavenrc ] ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$CLASSPATH" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
javaExecutable="$(which javac)"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -f "$1" ]; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
elif command -v shasum > /dev/null; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -f /etc/mavenrc ] ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
echo "Error: JAVA_HOME is not defined correctly." >&2
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
exit 1
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
$MAVEN_OPTS \
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -z "$1" ]
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$CLASSPATH" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -n "$JAVA_HOME" ] ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
# IBM's JDK on AIX uses strange locations for the executables
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
JAVACMD="$JAVA_HOME/jre/sh/java"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
echo "Warning: JAVA_HOME environment variable is not set."
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
basedir="$1"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
wdir="$1"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wrapperSha256Result=true
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
javaHome="$(dirname "\"$javaExecutable\"")"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 12 instead of at 10. Open
javaSource=$(cygpath --path --windows "$javaSource")
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
if [ -x "/usr/libexec/java_home" ]; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
export JAVA_HOME
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
Darwin*) darwin=true
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
basedir=$wdir
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 12 instead of at 10. Open
javaClass=$(cygpath --path --windows "$javaClass")
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wrapperSha256Result=true
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
JAVACMD="$JAVA_HOME/bin/java"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wdir=$(cd "$wdir/.." || exit 1; pwd)
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ $wrapperSha256Result = false ]; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
[ -n "$JAVA_HOME" ] &&
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
if [ -r /etc/gentoo-release ] ; then
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 8 instead of at 6. Open
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
- Create a ticketCreate a ticket
- Exclude checks
Expected an indentation at 4 instead of at 2. Open
wrapperSha256Result=false
- Create a ticketCreate a ticket
- Exclude checks