Skip to content

Commit 5c65c5f

Browse files
Clarify ignore patterns in Advanced Usage documentation (#107)
Updated the ignore patterns explanation to clarify that they are case-insensitive regular expressions and provided additional details on escaping dots in file extensions.
1 parent a711bda commit 5c65c5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wiki/Advanced-Usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ phpcs --ignore=*/tests/*,*/data/* /path/to/code
3636
```
3737

3838
> [!IMPORTANT]
39-
> The ignore patterns are treated as regular expressions. If you do specify a regular expression, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. So use `*` anywhere you would normally use `.*`. Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` instead.
39+
> The ignore patterns are treated as **case-insensitive** regular expressions. In addition to this, be aware that `*` is converted to `.*` for convenience in simple patterns, like those used in the example above. So use `*` anywhere you would normally use `.*`. Also ensure you escape any `.` characters that you want treated as a literal dot, such as when checking file extensions. So if you are checking for `.inc` in your ignore pattern, use `\.inc` or `\.inc$` instead.
4040
4141
You can also tell PHP_CodeSniffer to ignore a file using a special comment inserted at the top of the file. This will stop the file from being checked, even if it does not match the ignore pattern.
4242

0 commit comments

Comments
 (0)