Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768137
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
15 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/CodeSniffer/ruleset.xml b/CodeSniffer/ruleset.xml
index 6d3c66a..a2ac79b 100644
--- a/CodeSniffer/ruleset.xml
+++ b/CodeSniffer/ruleset.xml
@@ -1,81 +1,81 @@
<?xml version="1.0"?>
<ruleset name="Nasqueron" namespace="Nasqueron\CodeSniffer\Standard">
<description>Nasqueron coding standard</description>
<!-- Consensual detections -->
<rule ref="Generic.Classes.DuplicateClassName" />
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier" />
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<!-- Less consensual detections -->
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
<!-- Source is not the best project management and doc platform. -->
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.Commenting.Todo.TaskFound">
<message>Create a task in DevCentral instead of a TODO comment: %s</message>
</rule>
<!-- In a standardized world, every file use α encoding and β EOL. Oh my. -->
<rule ref="Generic.Files.ByteOrderMark" />
<rule ref="Generic.Files.EndFileNewline" />
<rule ref="Generic.Files.LineEndings" />
<!-- You're writing Nasqueron code. Let's use the Nasqueron code style. -->
<config name="tabWidth" value="4"/>
<rule ref="Generic.Classes.OpeningBraceSameLine" />
<rule ref="Generic.Formatting.NoSpaceAfterCast" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie" />
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
<properties>
<!-- Allow names like fetchFromAPI, getFS, getProjectsPHIDs -->
<property name="strict" value="false" />
</properties>
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
<rule ref="Generic.PHP.LowerCaseConstant" />
<rule ref="Generic.PHP.LowerCaseKeyword" />
<rule ref="Generic.WhiteSpace.DisallowTabIndent" />
<rule ref="PSR1" /> <!-- but certainly not the whole PSR-2 -->
<rule ref="PSR2.Files.ClosingTag" />
<!-- Long lines. -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="80"/>
<property name="absoluteLineLimit" value="120"/>
</properties>
</rule>
<rule ref="Generic.Files.LineLength.TooLong">
<severity>3</severity>
</rule>
<rule ref="Generic.Files.LineLength.MaxExceeded">
- <message>This line contains %2$s characters. Try below 80.</message>
+ <message>This line contains %2$s characters. Try below 80.</message>
</rule>
<!-- Write simple code. -->
<rule ref="Generic.CodeAnalysis.AssignmentInCondition" />
<rule ref="Generic.Files.OneClassPerFile" />
<rule ref="Generic.Files.OneInterfacePerFile" />
<rule ref="Generic.Files.OneTraitPerFile" />
<rule ref="Generic.Formatting.DisallowMultipleStatements" />
<rule ref="Generic.Metrics.CyclomaticComplexity" />
<rule ref="Generic.Metrics.NestingLevel" />
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
<!-- In modern PHP we trust. -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="Generic.Functions.CallTimePassByReference" />
<rule ref="Generic.NamingConventions.ConstructorName" />
<rule ref="Generic.PHP.DeprecatedFunctions" />
<rule ref="Generic.PHP.DisallowShortOpenTag" /> <!-- but <?= ?> ok -->
<rule ref="Generic.PHP.ForbiddenFunctions" /> <!-- sizeof/delete -->
</ruleset>
diff --git a/JetBrains/php-codestyle.xml b/JetBrains/php-codestyle.xml
index 393251b..ce76462 100644
--- a/JetBrains/php-codestyle.xml
+++ b/JetBrains/php-codestyle.xml
@@ -1,81 +1,81 @@
<code_scheme name="Nasqueron">
- <option name="OTHER_INDENT_OPTIONS">
- <value>
- <option name="INDENT_SIZE" value="4" />
- <option name="CONTINUATION_INDENT_SIZE" value="8" />
- <option name="TAB_SIZE" value="4" />
- <option name="USE_TAB_CHARACTER" value="true" />
- <option name="SMART_TABS" value="false" />
- <option name="LABEL_INDENT_SIZE" value="0" />
- <option name="LABEL_INDENT_ABSOLUTE" value="false" />
- <option name="USE_RELATIVE_INDENTS" value="false" />
- </value>
- </option>
- <PHPCodeStyleSettings>
- <option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
- <option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
- <option name="ALIGN_PHPDOC_COMMENTS" value="true" />
- <option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
- <option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
- <option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
- <option name="PHPDOC_WRAP_LONG_LINES" value="true" />
- <option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
- <option name="LOWER_CASE_NULL_CONST" value="true" />
- <option name="ELSE_IF_STYLE" value="COMBINE" />
- <option name="BLANK_LINE_BEFORE_RETURN_STATEMENT" value="true" />
- <option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
- <option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
- <option name="SPACE_BEFORE_COLON_IN_RETURN_TYPE" value="true" />
- <option name="PHPDOC_USE_FQCN" value="true" />
- </PHPCodeStyleSettings>
- <XML>
- <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
- </XML>
- <codeStyleSettings language="JSON">
- <indentOptions>
- <option name="INDENT_SIZE" value="4" />
- </indentOptions>
- </codeStyleSettings>
- <codeStyleSettings language="PHP">
- <option name="RIGHT_MARGIN" value="80" />
- <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
- <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
- <option name="BLANK_LINES_AFTER_PACKAGE" value="1" />
- <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
- <option name="CLASS_BRACE_STYLE" value="1" />
- <option name="METHOD_BRACE_STYLE" value="1" />
- <option name="CATCH_ON_NEW_LINE" value="true" />
- <option name="SPECIAL_ELSE_IF_TREATMENT" value="true" />
- <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
- <option name="ALIGN_MULTILINE_FOR" value="false" />
- <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
- <option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
- <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
- <option name="SPACE_BEFORE_SEMICOLON" value="true" />
- <option name="SPACE_AFTER_TYPE_CAST" value="false" />
- <option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
- <option name="CALL_PARAMETERS_WRAP" value="1" />
- <option name="METHOD_PARAMETERS_WRAP" value="5" />
- <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
- <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
- <option name="EXTENDS_LIST_WRAP" value="1" />
- <option name="EXTENDS_KEYWORD_WRAP" value="1" />
- <option name="METHOD_CALL_CHAIN_WRAP" value="5" />
- <option name="PARENTHESES_EXPRESSION_RPAREN_WRAP" value="true" />
- <option name="BINARY_OPERATION_WRAP" value="1" />
- <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
- <option name="TERNARY_OPERATION_WRAP" value="1" />
- <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
- <option name="FOR_STATEMENT_WRAP" value="1" />
- <option name="FOR_STATEMENT_LPAREN_ON_NEXT_LINE" value="true" />
- <option name="FOR_STATEMENT_RPAREN_ON_NEXT_LINE" value="true" />
- <option name="ARRAY_INITIALIZER_WRAP" value="5" />
- <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
- <option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
- <option name="ASSIGNMENT_WRAP" value="1" />
- <option name="IF_BRACE_FORCE" value="3" />
- <option name="DOWHILE_BRACE_FORCE" value="3" />
- <option name="WHILE_BRACE_FORCE" value="3" />
- <option name="FOR_BRACE_FORCE" value="3" />
- </codeStyleSettings>
+ <option name="OTHER_INDENT_OPTIONS">
+ <value>
+ <option name="INDENT_SIZE" value="4" />
+ <option name="CONTINUATION_INDENT_SIZE" value="8" />
+ <option name="TAB_SIZE" value="4" />
+ <option name="USE_TAB_CHARACTER" value="true" />
+ <option name="SMART_TABS" value="false" />
+ <option name="LABEL_INDENT_SIZE" value="0" />
+ <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+ <option name="USE_RELATIVE_INDENTS" value="false" />
+ </value>
+ </option>
+ <PHPCodeStyleSettings>
+ <option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
+ <option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
+ <option name="ALIGN_PHPDOC_COMMENTS" value="true" />
+ <option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
+ <option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
+ <option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
+ <option name="PHPDOC_WRAP_LONG_LINES" value="true" />
+ <option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
+ <option name="LOWER_CASE_NULL_CONST" value="true" />
+ <option name="ELSE_IF_STYLE" value="COMBINE" />
+ <option name="BLANK_LINE_BEFORE_RETURN_STATEMENT" value="true" />
+ <option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
+ <option name="FORCE_SHORT_DECLARATION_ARRAY_STYLE" value="true" />
+ <option name="SPACE_BEFORE_COLON_IN_RETURN_TYPE" value="true" />
+ <option name="PHPDOC_USE_FQCN" value="true" />
+ </PHPCodeStyleSettings>
+ <XML>
+ <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+ </XML>
+ <codeStyleSettings language="JSON">
+ <indentOptions>
+ <option name="INDENT_SIZE" value="4" />
+ </indentOptions>
+ </codeStyleSettings>
+ <codeStyleSettings language="PHP">
+ <option name="RIGHT_MARGIN" value="80" />
+ <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
+ <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
+ <option name="BLANK_LINES_AFTER_PACKAGE" value="1" />
+ <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
+ <option name="CLASS_BRACE_STYLE" value="1" />
+ <option name="METHOD_BRACE_STYLE" value="1" />
+ <option name="CATCH_ON_NEW_LINE" value="true" />
+ <option name="SPECIAL_ELSE_IF_TREATMENT" value="true" />
+ <option name="ALIGN_MULTILINE_CHAINED_METHODS" value="true" />
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
+ <option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
+ <option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
+ <option name="ALIGN_MULTILINE_ARRAY_INITIALIZER_EXPRESSION" value="true" />
+ <option name="SPACE_BEFORE_SEMICOLON" value="true" />
+ <option name="SPACE_AFTER_TYPE_CAST" value="false" />
+ <option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
+ <option name="CALL_PARAMETERS_WRAP" value="1" />
+ <option name="METHOD_PARAMETERS_WRAP" value="5" />
+ <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
+ <option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
+ <option name="EXTENDS_LIST_WRAP" value="1" />
+ <option name="EXTENDS_KEYWORD_WRAP" value="1" />
+ <option name="METHOD_CALL_CHAIN_WRAP" value="5" />
+ <option name="PARENTHESES_EXPRESSION_RPAREN_WRAP" value="true" />
+ <option name="BINARY_OPERATION_WRAP" value="1" />
+ <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
+ <option name="TERNARY_OPERATION_WRAP" value="1" />
+ <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
+ <option name="FOR_STATEMENT_WRAP" value="1" />
+ <option name="FOR_STATEMENT_LPAREN_ON_NEXT_LINE" value="true" />
+ <option name="FOR_STATEMENT_RPAREN_ON_NEXT_LINE" value="true" />
+ <option name="ARRAY_INITIALIZER_WRAP" value="5" />
+ <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
+ <option name="ARRAY_INITIALIZER_RBRACE_ON_NEXT_LINE" value="true" />
+ <option name="ASSIGNMENT_WRAP" value="1" />
+ <option name="IF_BRACE_FORCE" value="3" />
+ <option name="DOWHILE_BRACE_FORCE" value="3" />
+ <option name="WHILE_BRACE_FORCE" value="3" />
+ <option name="FOR_BRACE_FORCE" value="3" />
+ </codeStyleSettings>
</code_scheme>
diff --git a/pre-commit-hooks/shellcheck.sh b/pre-commit-hooks/shellcheck.sh
index a536b81..51f3685 100755
--- a/pre-commit-hooks/shellcheck.sh
+++ b/pre-commit-hooks/shellcheck.sh
@@ -1,61 +1,61 @@
#!/usr/bin/env bash
# -------------------------------------------------------------
# pre-commit :: hooks :: shellcheck
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Forked from: gruntwork-io/pre-commit
# Authors: 06kellyjac
# Mark Butcher
# Yevgeniy Brikman
# Description: Call shellcheck as pre-commit hook
# License: Apache License 2.0
# -------------------------------------------------------------
set -e
exit_status=0
enable_list=""
severity="style"
parse_arguments() {
- while (($# > 0)); do
- # Grab param and value splitting on " " or "=" with parameter expansion
- local PARAMETER="${1%[ =]*}"
- local VALUE="${1#*[ =]}"
- if [[ "$PARAMETER" == "$VALUE" ]]; then VALUE="$2"; fi
- shift
- case "$PARAMETER" in
- --enable)
- enable_list="$enable_list $VALUE"
- ;;
- --severity)
- severity=$VALUE
- ;;
- -*)
- echo "Error: Unknown option: $PARAMETER" >&2
- exit 1
- ;;
- *)
- files="$files $PARAMETER"
- ;;
- esac
- done
- enable_list="${enable_list## }" # remove preceeding space
+ while (($# > 0)); do
+ # Grab param and value splitting on " " or "=" with parameter expansion
+ local PARAMETER="${1%[ =]*}"
+ local VALUE="${1#*[ =]}"
+ if [[ "$PARAMETER" == "$VALUE" ]]; then VALUE="$2"; fi
+ shift
+ case "$PARAMETER" in
+ --enable)
+ enable_list="$enable_list $VALUE"
+ ;;
+ --severity)
+ severity=$VALUE
+ ;;
+ -*)
+ echo "Error: Unknown option: $PARAMETER" >&2
+ exit 1
+ ;;
+ *)
+ files="$files $PARAMETER"
+ ;;
+ esac
+ done
+ enable_list="${enable_list## }" # remove preceeding space
}
parse_arguments "$@"
for FILE in $files; do
- SHEBANG_REGEX='^#!\(/\|/.*/\|/.* \)\(\(ba\|da\|k\|a\)*sh\|bats\)$'
- if (head -1 "$FILE" | grep "$SHEBANG_REGEX" >/dev/null); then
- if ! shellcheck ${enable_list:+ --enable="$enable_list"} --severity="$severity" "$FILE"; then
- exit_status=1
- fi
- elif [[ "$FILE" =~ .+\.(sh|bash|dash|ksh|ash|bats)$ ]]; then
- echo "$FILE: missing shebang"
- exit_status=1
- fi
+ SHEBANG_REGEX='^#!\(/\|/.*/\|/.* \)\(\(ba\|da\|k\|a\)*sh\|bats\)$'
+ if (head -1 "$FILE" | grep "$SHEBANG_REGEX" >/dev/null); then
+ if ! shellcheck ${enable_list:+ --enable="$enable_list"} --severity="$severity" "$FILE"; then
+ exit_status=1
+ fi
+ elif [[ "$FILE" =~ .+\.(sh|bash|dash|ksh|ash|bats)$ ]]; then
+ echo "$FILE: missing shebang"
+ exit_status=1
+ fi
done
exit $exit_status
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 06:46 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259629
Default Alt Text
(15 KB)
Attached To
Mode
rDEVCS Nasqueron codestyle
Attached
Detach File
Event Timeline
Log In to Comment