Edit report at https://pear.php.net/bugs/bug.php?id=20364&edit=1
ID: 20364
Updated by: [email protected]
Reported By: ads at moneymail dot de
Summary: Unclear usage of regexes in exclude patterns
-Status: Open
+Status: Duplicate
Type: Documentation Problem
Package: PHP_CodeSniffer
Package Version: 2.0.0RC1
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
-Status: Open
+Status: Duplicate
Duplicate submission.
Previous Comments:
------------------------------------------------------------------------
[2014-08-07 21:47:21] #bae10b2e413c604df0e
Description:
------------
Hello,
due to quite incomplete docs I'm trying to find out the exact
possibilities of exclude patterns.
However, some questions remain:
1.
Obviously, exclude patterns are rendered as regexes. In some issues
concerning excl-pat's regular expression syntax is recommended (e.g.
issue #19648).
However, what's the point then of hard-coded string-replace of "\\," to
"," and "*" to ".*" before processing the regex?
a)
I see some convenience to simply use "*" - but leads to some regexes
failing where they shouldn't:
The regex "^application/test.*\.php" is changed to
"^application/test..*\.php" which leads the file "application/test.php"
to fail although my original regex includes this file!
b)
What about the "\\," to "," thing?
2.
Why are exclude patterns processed differently for global use and
per-sniff?
I have the concrete problem that (using Windows) for global usage both
patterns "application\\" and "application/" work perfectly fine, while
on per-sniff basis only "application\\" works obviously which prevents
portability to *NIX systems.
------------------------------------------------------------------------
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20364&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.