title: How can we customize Wordpress coding standards and use them in VSCode?
body: <p>How can we customize <a href="https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards" rel="nofollow noreferrer">Wordpress coding standards</a> on Windows and use them with VSCode? 
  I am trying to do this globally so I don't have to do it for every project (I don't think currently that this is a bad idea?) but I guess the same thing can be applied to local project, only paths should be changed.</p>
  
  <p>First, I have installed them in <code>C:\wamp64\www\_standards\wpcs</code> and I have set correct path using:</p>
  
  <pre><code>phpcs --config-set installed_paths C:\wamp64\www\_standards\wpcs
  </code></pre>
  
  <p>Now when I do <code>phpcs -i</code> I can see that WordPress standards are installed</p>
  
  <pre><code>The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra and WordPress-VIP
  </code></pre>
  
  <p>and in VSCode User Settings I did</p>
  
  <pre><code>"phpcs.enable": true,
  "phpcs.standard": "WordPress"
  </code></pre>
  
  <p>So far everything seems to be working nicely. Now, how do I customize them and disable few things, like <code>Spaces must be used to indent lines; tabs are not allowed</code>?</p>
  
  <p>There is something written <a href="https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards#using-a-custom-ruleset" rel="nofollow noreferrer">about using custom rules</a> and <a href="https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample" rel="nofollow noreferrer">here is their sample file</a>, so I created <code>C:\wamp64\www\_standards\phpcs.xml</code> file</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;ruleset name="Custom"&gt;
  
       &lt;!-- Enable colors in report --&gt;
       &lt;arg name="colors"/&gt;
  
       &lt;!-- Add source codes in the report --&gt;
       &lt;arg value="s"/&gt;
  
       &lt;!-- Load WordPress Coding standards --&gt;
       &lt;rule ref="WordPress"/&gt;
  
       &lt;!-- Customize --&gt;
       &lt;rule ref="WordPress"&gt;
            &lt;exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" /&gt;
       &lt;/rule&gt;
  
  &lt;/ruleset&gt;
  </code></pre>
  
  <p>This way nothing shows up after I do <code>phpcs -i</code> (not even WordPress standards show up)</p>
  
  <pre><code>phpcs --config-set installed_paths C:\wamp64\www\_posao\_standards\wpcs,C:\wamp64\www\_posao\_standards
  </code></pre>
  
  <p>But, if I rename <code>phpcs.xml</code> to <code>ruleset.xml</code> and I repeat previous code for installing paths I get this</p>
  
  <pre><code>The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs, WordPress-Extra, WordPress-VIP and _standards
  </code></pre>
  
  <p>So I changed User Settings in VSCode </p>
  
  <pre><code>phpcs.standard": "_standards"
  </code></pre>
  
  <p>Now, how do I rename this <code>_standards</code> to a better name and how do I load WordPress standards first and overwrite it with custom rules? Because contents of file, if they are even loaded, aren't used - I still get <code>Spaces must be used to indent lines; tabs are not allowed</code> when I manually call <code>phpcs page.php</code>. </p>
  
  <p>EDIT: So, since I had WPCS installed outside of projects with config-set already pointing to that folder, I have placed only <code>phpcs.xml</code> file inside Wordpress theme and now I can manually call <code>phpcs page.php</code> - it works nice. But now is the problem that I can't set it in VSCode so that it automatically runs after saving file?</p>