Many projects automatically exclude from PHPCS runs any file that has interdif in the name, so that simply running phpcs . will not report on files that need no attention. I suggest that Typed Data also excludes these.

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new777 bytes

Here's a patch to exclude all files which have interdif in the filename. I also noticed that we are being to strong when excluding _ignore. This should only exclude files which start with _ignore. The patch makes this change too, but allows any number of _ at the start of the file name before the 'ignore'

jonathan1055’s picture

StatusFileSize
new777 bytes

Minor typo in patch #2. <exclude-pattern>\/_*ignore</exclude-pattern> should be <exclude-pattern>\/_+ignore</exclude-pattern> The * was a complete wildcard but it should be + to mean any number of the previous character (i.e. underscore only)

tree2009’s picture

Status: Needs review » Reviewed & tested by the community
jonathan1055’s picture

@TR If you don't want to commit this, it can be solved another way. I have created a command alias for phpcs which contains --ignore=interdiff and the key thing is that any ignore value given in the command (or alias) will be used in addition to the exclusions already contained in phpcs.xml.diff. The full alias I have is alias pcs='phpcs -s --colors --ignore=interdif'

  • TR committed 3cf757f on 8.x-1.x authored by jonathan1055
    Issue #3165629 by jonathan1055: Exclude interdif files from phpcs
    
tr’s picture

Status: Reviewed & tested by the community » Fixed

I think the ultimate goal is to do away with the phpcs.xml.dist entirely, and use the core defaults. Also, I don't see this file as something designed for local development where you might have interdiff files and other things lying around - rather it is primarily for the testbot. I would not ever expect a vendor directory or interdiff files in either the repository or the patch being tested, so we really shouldn't have to declare anything as ignored.

But it doesn't hurt either, so committed.

jonathan1055’s picture

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.