Closed (works as designed)
Project:
Coder
Version:
8.x-3.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2020 at 07:21 UTC
Updated:
5 Sep 2020 at 10:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jonathan1055 commentedPatch to do this. I also added
<arg value="s"/>to automatically display the full sniff name (which is very helpful when developing Coder).I can make a PR for this if required.
Comment #3
arkener commentedCoder uses an inclusion list based setup to ensure that we only check the actual rules and test files. This list can be used by using the
phpcscommand (or./vendor/bin/phpcsif PHPCS isn't installed globally) omitting the.argument. This way the vendor directory should already be excluded from the sniff results.The issue with adding default arguments via the xml file is that there is no way to override these arguments when using the command line (except for color, which can be disabled by adding --no-colors). An easy way to apply these arguments to your development environment would be by copying the
phpcs.xml.distfile tophpcs.xmland adding the arguments there.Comment #4
jonathan1055 commentedThanks Arkener, that's helpful. I did not realise that if I run just
phpcswithout the . then the files to check are limited by what is specified in the phpcs.xml.dist - I don't know why I did not realise that. It works perfectly.For the default parameters, yes I totally get your point about not adding to the file, that's fine. So now I have my own
phpcs.xmlfile, but instead of duplicating the .dist file what I am trying to do is use<xinclude>to include all info from the .dist file, then add my own custom parameters. But it is not working.So I have just made an alias in my profile for
alias pcs='phpcs -s --colors'which does the trick.Comment #5
klausiPerfect, totally agree with you both and I think Jonathan has found an acceptable solution for his workflow.