Codeniffer using the standard indent of a standard pear line

using the pear standard code. I got more than 20 tf errors due to linear indentation. I use tab-stop for indentation. I am trying to disable this check, but I have failed.

I removed the last rule from the general standards in ruleset.xml for the pear standard. However, indentation is still considered a mistake.

How to completely remove indentation checks for a pear standard?

+6
source share
2 answers

You can achieve this by searching for the next file, “ScopeIndentSniff.php”, it should be in a folder called “WhiteSpace” in accordance with the standards. Just rename it. Keep in mind that applications may have their own standards folder. For example, Eclipse has its own folder in which standards will remain. Therefore, if you edit your shared folder, this may not apply. But you can also configure Eclipse to use its public folder. (Settings → PHP Tools → CodeSniffer → CodeSniffer Standards)

0
source

It should work, so you should definitely try to understand why setting up your ruleset.xml file ruleset.xml not work in your environment, otherwise you will not be given many functions from CodeSniffer.

We remind you that here are two options:

  • Or, you explicitly exclude sniff in your rule set:

     <rule ref="PEAR"> <exclude name="PEAR.WhiteSpace.ScopeIndent" /> </rule> 
  • Or you disable a specific error message, as a result of which the rule is actually executed for potential other error messages:

     <rule ref="PEAR.WhiteSpace.ScopeIndent.Incorrect"> <severity>0</severity> </rule> 
+5
source

Source: https://habr.com/ru/post/906486/


All Articles