[wp-trac] [WordPress Trac] #47411: Build tools, WPCS: disable line ending check
WordPress Trac
noreply at wordpress.org
Thu Apr 9 10:32:37 UTC 2020
#47411: Build tools, WPCS: disable line ending check
------------------------------+-------------------------------
Reporter: azaozz | Owner: azaozz
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 5.5
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses: coding-standards
------------------------------+-------------------------------
Comment (by SergeyBiryukov):
Replying to [comment:18 SergeyBiryukov]:
> > It's still doesn't make sense to me that `phpcbf` converts all files
to `\n` to enforce Unix EOLs on Windows, then SVN converts them back to
`\r\n`, over and over again.
>
> These back-and-forth changes take a significant amount of time and are
completely unnecessary.
>
> Since core has `svn:eol-style` set to `native` for most of the files,
the `Generic.Files.LineEndings` sniff is simply not relevant for us and
should be excluded entirely, as it's not a part of WPCS.
After reading @jrf's reply on the GitHub issue, I'm not so sure anymore :)
It makes sense to me that the sniff is there to help correct mixed line
endings if someone encounters them accidentally.
What doesn't make sense to me is that the sniff enforces Unix line endings
regardless of the platform, which is incompatible with our `svn:eol-style:
native` setting. As noted above, this is a global setting and cannot be
changed locally. This results in `phpcbf` and SVN competing with each
other and performing conflicting back-and-forth changes on all PHP files.
Certainly, I can exclude that sniff in my local `phpcs.xml`, and have
already done so.
* Is that really the recommended way for anyone contributing to core using
SVN on Windows?
* Should we reconsider the usage of `svn:eol-style: native`?
* Is there any way to configure that sniff to set the `eolChar` value
based on the platform?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47411#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list