Closed mbabker closed 6 years ago
How would we do this?
Currently an @package
tag is required unless the "file" is namespaced. PHPCS doesn't check the project it checks individual files. (To me this is similar to the issue we run into with the DuplicateClassName Sniff, PHPCS is not package aware at a level of sophistication necessary to make the sniff useful)
I would suggest there are two options here
Maybe we flip the logic on this. We're reaching a point where more of our project code is now namespaced (or in a project that is only namespaced) than not, so perhaps it's time to make that sniff optional and in projects that still require it, they have to extend the base ruleset to add it.
The great thing about the ruleset.xml is you can create your own and make any of the rules optional as needed by selectively applying rules. as described in the readme examples provided just place the example ruleset in the standards folder of phpcs and it should be installed.
With merging #204 are we good to close this?
The handling in
Joomla_Sniffs_Commenting_FileCommentSniff
which handles detecting if a file needs a@package
tag should be improved. For example, running the sniff against https://github.com/joomla/framework.joomla.org/blob/master/phinx.php results in:This is an entirely procedural file and is part of a project which is fully namespaced, so this error should not be raised.