Created
April 25, 2019 18:02
Star
You must be signed in to star a gist
Codeclimate base for Drupal 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: "2" | |
plugins: | |
phpmd: | |
enabled: true | |
config: | |
file_extensions: | |
- php | |
- inc | |
- module | |
rulesets: ".phpmd.xml" | |
phpcodesniffer: | |
enabled: true | |
config: | |
file_extensions: | |
- php | |
- inc | |
- module | |
encoding: utf-8 | |
standard: "Drupal" | |
ignore_warnings: true | |
sonar-php: | |
enabled: true | |
config: | |
tests_patterns: | |
- sites/all/modules/custom/**/*.php | |
- sites/all/modules/custom/**/*.inc | |
- sites/all/modules/custom/**/*.module | |
- sites/all/themes/bushbeans/**/*.php | |
- sites/all/themes/bushbeans/**/*.inc | |
minimum_severity: critical | |
eslint: | |
enabled: true | |
config: | |
config: .eslintrc.json | |
extensions: | |
- .js | |
- .jsx | |
ignore_warnings: true | |
exclude_patterns: | |
- "**/Test/**/*" | |
- config | |
- docs | |
- includes | |
- misc | |
- modules | |
- profiles | |
- scripts | |
- sites/all/libraries | |
- sites/all/modules/contrib | |
- sites/all/modules/features | |
- sites/all/themes/zen | |
- sites/all/themes/bushbeans/dist | |
- sites/default | |
- sites/*.php | |
- themes | |
- toolkit | |
- vendor | |
- ./*.php | |
{ | |
"env": { | |
"browser": true | |
}, | |
"globals": { | |
"Drupal": true, | |
"jQuery": true, | |
"tinyMCE": true | |
}, | |
"rules": { | |
"eqeqeq": [2, "smart"], | |
"guard-for-in": 2, | |
"no-undef": 2, | |
//"no-unused-vars": [2, {"vars": "local", "args": "none"}], | |
"no-unused-vars": 0, | |
"strict": 0, | |
"new-cap": 0, | |
"quotes": 0, | |
"camelcase": 0, | |
"no-underscore-dangle": 0, | |
"no-new": 0, | |
"no-alert": 0, | |
"no-use-before-define": 0, | |
"consistent-return": 0, | |
"no-constant-condition": 0, | |
"comma-dangle": [ | |
"error", | |
"always-multiline" | |
], | |
"no-catch-shadow" : 2 | |
} | |
} | |
<?xml version="1.0"?> | |
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PMD Ruleset for Drupal" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> | |
<description> | |
A PMD Ruleset for Drupal coding standards. | |
</description> | |
<!-- | |
Include each rule explicitly so we know what we have. | |
@see https://github.com/phpmd/phpmd/blob/master/src/main/resources/rulesets/ | |
--> | |
<!-- Clean Code --> | |
<!-- | |
These don't align with Drupal standards, so they are excluded. | |
@todo Static calls are hard to test and extend, is there a way to whitelist the ones that are OK? | |
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/> | |
<rule ref="rulesets/cleancode.xml/ElseExpression"/> | |
<rule ref="rulesets/cleancode.xml/StaticAccess"/> | |
--> | |
<!-- Code Size --> | |
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/> | |
<rule ref="rulesets/codesize.xml/NPathComplexity"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/> | |
<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/> | |
<rule ref="rulesets/codesize.xml/TooManyFields"/> | |
<!-- Controversial --> | |
<rule ref="rulesets/controversial.xml/Superglobals"/> | |
<!-- | |
These checks do not need to be included since PHPCS will check for style. | |
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/> | |
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/> | |
--> | |
<!-- Design --> | |
<rule ref="rulesets/design.xml/ExitExpression"/> | |
<rule ref="rulesets/design.xml/EvalExpression"/> | |
<rule ref="rulesets/design.xml/GotoStatement"/> | |
<rule ref="rulesets/design.xml/NumberOfChildren"/> | |
<rule ref="rulesets/design.xml/DepthOfInheritance"/> | |
<rule ref="rulesets/design.xml/CouplingBetweenObjects"/> | |
<rule ref="rulesets/design.xml/DevelopmentCodeFragment"/> | |
<!-- Naming --> | |
<rule ref="rulesets/naming.xml/ShortVariable"> | |
<properties> | |
<!-- Allow $id as a variable name. --> | |
<property name="exceptions" description="Comma-separated list of exceptions" value="id"/> | |
</properties> | |
</rule> | |
<rule ref="rulesets/naming.xml/LongVariable"> | |
<properties> | |
<!-- Bump variable length to a more reasonable number. --> | |
<property name="maximum" description="The variable length reporting threshold" value="35"/> | |
</properties> | |
</rule> | |
<rule ref="rulesets/naming.xml/ShortMethodName"/> | |
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass"/> | |
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/> | |
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/> | |
<!-- Unused Code --> | |
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/> | |
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/> | |
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/> | |
<!-- | |
Hooks often have unused parameters, so ignore this warning. | |
@todo is there a way to allow unused parameters in hooks but not elsewhere? | |
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/> | |
--> | |
</ruleset> | |
--- | |
version: "2" | |
plugins: | |
phpmd: | |
enabled: true | |
config: | |
file_extensions: | |
- php | |
- inc | |
- module | |
rulesets: ".phpmd.xml" | |
phpcodesniffer: | |
enabled: true | |
config: | |
file_extensions: | |
- php | |
- inc | |
- module | |
encoding: utf-8 | |
standard: "Drupal" | |
ignore_warnings: true | |
sonar-php: | |
enabled: true | |
config: | |
tests_patterns: | |
- sites/all/modules/custom/**/*.php | |
- sites/all/modules/custom/**/*.inc | |
- sites/all/modules/custom/**/*.module | |
- sites/all/themes/<theme>/**/*.php | |
- sites/all/themes/<theme>/**/*.inc | |
minimum_severity: critical | |
eslint: | |
enabled: true | |
config: | |
config: .eslintrc.json | |
extensions: | |
- .js | |
- .jsx | |
ignore_warnings: true | |
exclude_patterns: | |
- "**/Test/**/*" | |
- config | |
- docs | |
- includes | |
- misc | |
- modules | |
- profiles | |
- scripts | |
- sites/all/libraries | |
- sites/all/modules/contrib | |
- sites/all/modules/features | |
- sites/all/themes/zen | |
- sites/default | |
- sites/*.php | |
- themes | |
- toolkit | |
- vendor | |
- ./*.php | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"browser": true | |
}, | |
"globals": { | |
"Drupal": true, | |
"jQuery": true, | |
"tinyMCE": true | |
}, | |
"rules": { | |
"eqeqeq": [2, "smart"], | |
"guard-for-in": 2, | |
"no-undef": 2, | |
//"no-unused-vars": [2, {"vars": "local", "args": "none"}], | |
"no-unused-vars": 0, | |
"strict": 0, | |
"new-cap": 0, | |
"quotes": 0, | |
"camelcase": 0, | |
"no-underscore-dangle": 0, | |
"no-new": 0, | |
"no-alert": 0, | |
"no-use-before-define": 0, | |
"consistent-return": 0, | |
"no-constant-condition": 0, | |
"comma-dangle": [ | |
"error", | |
"always-multiline" | |
], | |
"no-catch-shadow" : 2 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PMD Ruleset for Drupal" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> | |
<description> | |
A PMD Ruleset for Drupal coding standards. | |
</description> | |
<!-- | |
Include each rule explicitly so we know what we have. | |
@see https://github.com/phpmd/phpmd/blob/master/src/main/resources/rulesets/ | |
--> | |
<!-- Clean Code --> | |
<!-- | |
These don't align with Drupal standards, so they are excluded. | |
@todo Static calls are hard to test and extend, is there a way to whitelist the ones that are OK? | |
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/> | |
<rule ref="rulesets/cleancode.xml/ElseExpression"/> | |
<rule ref="rulesets/cleancode.xml/StaticAccess"/> | |
--> | |
<!-- Code Size --> | |
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/> | |
<rule ref="rulesets/codesize.xml/NPathComplexity"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/> | |
<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/> | |
<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/> | |
<rule ref="rulesets/codesize.xml/TooManyFields"/> | |
<!-- Controversial --> | |
<rule ref="rulesets/controversial.xml/Superglobals"/> | |
<!-- | |
These checks do not need to be included since PHPCS will check for style. | |
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/> | |
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/> | |
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/> | |
--> | |
<!-- Design --> | |
<rule ref="rulesets/design.xml/ExitExpression"/> | |
<rule ref="rulesets/design.xml/EvalExpression"/> | |
<rule ref="rulesets/design.xml/GotoStatement"/> | |
<rule ref="rulesets/design.xml/NumberOfChildren"/> | |
<rule ref="rulesets/design.xml/DepthOfInheritance"/> | |
<rule ref="rulesets/design.xml/CouplingBetweenObjects"/> | |
<rule ref="rulesets/design.xml/DevelopmentCodeFragment"/> | |
<!-- Naming --> | |
<rule ref="rulesets/naming.xml/ShortVariable"> | |
<properties> | |
<!-- Allow $id as a variable name. --> | |
<property name="exceptions" description="Comma-separated list of exceptions" value="id"/> | |
</properties> | |
</rule> | |
<rule ref="rulesets/naming.xml/LongVariable"> | |
<properties> | |
<!-- Bump variable length to a more reasonable number. --> | |
<property name="maximum" description="The variable length reporting threshold" value="35"/> | |
</properties> | |
</rule> | |
<rule ref="rulesets/naming.xml/ShortMethodName"/> | |
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass"/> | |
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/> | |
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/> | |
<!-- Unused Code --> | |
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/> | |
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/> | |
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/> | |
<!-- | |
Hooks often have unused parameters, so ignore this warning. | |
@todo is there a way to allow unused parameters in hooks but not elsewhere? | |
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/> | |
--> | |
</ruleset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment