Skip to content

Instantly share code, notes, and snippets.

@caschbre
Created January 22, 2021 16:25
Show Gist options
  • Save caschbre/22971e36fbcdc17d089fc424b491b598 to your computer and use it in GitHub Desktop.
Save caschbre/22971e36fbcdc17d089fc424b491b598 to your computer and use it in GitHub Desktop.
Coc Diagnostic / phpcs settings
{
"intelephense.completion.maxItems": 10,
"intelephense.diagnostics.enable": false,
"intelephense.environment.documentRoot": "../drupal",
"intelephense.environment.includePaths": [
"../src/modules",
"../src/themes"
],
"intelephense.environment.phpVersion": "7.2.24",
"intelephense.files.associations": [
"*.php",
"*.module",
"*.inc",
"*.install"
],
"intelephense.format.enable": false,
"intelephense.licenceKey": "~/.intelephense",
"diagnostic-languageserver.filetypes": {
"php": ["phpcs"]
},
"diagnostic-languageserver.linters": {
"phpcs": {
"sourceName": "phpcs",
"command": "./vendor/bin/phpcs",
"debounce": 100,
"rootPatterns": [".projectroot"],
"args": ["--standard=Drupal,DrupalPractice", "--report=emacs", "-s", "-"],
"offsetLine": 0,
"offsetColumn": 0,
"formatLines": 1,
"formatPattern": [
"^.*:(\\d+):(\\d+):\\s+(.*)\\s+-\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": 4,
"security": 3
}
],
"securities": {
"error": "error",
"warning": "warning"
}
}
},
"diagnostic-languageserver.formatFiletypes": {
"php": ["phpcbf"]
},
"diagnostic-languageserver.formatters": {
"phpcbf": {
"command": "./vendor/bin/phpcbf",
"rootPatterns": [".projectroot", "phpcs.xml.dist"],
"args": ["--standard=Drupal", "-"]
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="lessonface">
<description>PHP CodeSniffer configuration for Lessonface development.</description>
<!-- Check all files in the current directory and below. -->
<file>.</file>
<arg name="extensions" value="php,module,inc,install,test,profile,info"/>
<!-- Change this value to 7 if you want to check Drupal 7 code. -->
<config name="drupal_core_version" value="7"/>
<!--
<exclude name="Generic.WhiteSpace.ScopeIndent.Incorrect"/>
<exclude name="Drupal.NamingConventions.ValidGlobal.GlobalUnderScore"/>
-->
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>
<exclude name="DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
<!-- If you have Coder installed locally then you can reference the Drupal
standards with relative paths. Otherwise simply use "Drupal" and
"DrupalPractice. -->
<rule ref="../vendor/drupal/coder/coder_sniffer/Drupal">
<exclude name="Drupal.Arrays.Array.LongLineDeclaration"/>
<exclude name="Drupal.NamingConventions.ValidGlobal.GlobalUnderScore"/>
<!-- Example how you would disable a rule you are not compliant with yet:
<exclude name="Drupal.Commenting.Deprecated"/>
-->
</rule>
<rule ref="../vendor/drupal/coder/coder_sniffer/DrupalPractice">
<exclude name="DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable"/>
</rule>
<!-- Example how you would disable an external rule you do not like:
<rule ref="PEAR.Functions.ValidDefaultValue.NotAtEnd">
<severity>0</severity>
</rule>
-->
</ruleset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment