Open
Description
Bug Description
The WordPress.Files.FileName.InvalidTemplateTagFileName
sniff incorrectly throws an error on src/wp-includes/template.php
. This file is part of the Template
subpackage, but doesn't contain template tags.
Minimal Code Snippet
$ vendor/bin/phpcs --sniffs=WordPress.Files.FileName src/wp-includes/template.php
E 1 / 1 (100%)
FILE: src/wp-includes/template.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | Files containing template tags should have "-template" appended to the end of the file name. Expected template-template.php, but found template.php.
| | (WordPress.Files.FileName.InvalidTemplateTagFileName)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
For bugs with fixers: How was the code fixed? How did you expect the code to be fixed?
Error Code
WordPress.Files.FileName.InvalidTemplateTagFileName
Environment
Question | Answer |
---|---|
PHP version | 7.1.23 |
PHP_CodeSniffer version | 3.3.1 |
WPCS version | 1.0.0 |
WPCS install type | Composer project local |
Tested Against develop
branch?
- I have verified the issue still exists in the
develop
branch of WPCS.