Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: remove redundant @package tags #320

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Docs: remove redundant @package tags
`@package` tags are an arcane manner to group related files as belonging to one project.

For projects using namespaces, the current recommendation is to only have `@package` tags when they have supplemental information to the namespace.

As that isn't the case in YoastCS (with the exception of the non-namespaced test bootstrap file), I'm proposing to remove the `@package` tags from the YoastCS class docblocks.

Along the same lines, the `@author` tag is also an outdated practice as `git blame` will work just fine, so I'm removing those too.

Includes cleaning up (normalizing) the tag description alignments in the class docblocks.

:point_right: reviewing with whitespace changes ignored should make it easier to see that the only real change is the removal of the package/author tags.

Refs:
* https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/package.html#package
* https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#59-package
  • Loading branch information
jrfnl committed Nov 3, 2023
commit 820adfb9e188b0378d456aada0e788743c39775e
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
* Verifies functions which are marked as `deprecated` have a `codeCoverageIgnore` tag
* in their docblock.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.1.0
* @since 1.1.0
*/
class CodeCoverageIgnoreDeprecatedSniff implements Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/Commenting/CoversTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
* - there are no duplicate @coversNothing tags;
* - a method does not have both a @covers as well as a @coversNothing tag.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.3.0
* @since 1.3.0
*/
class CoversTagSniff implements Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/Commenting/FileCommentSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
* see if it's still relevant to have this sniff and if so, if the sniff needs
* adjustments.}}
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.2.0
* @since 1.2.0
*/
class FileCommentSniff extends Squiz_FileCommentSniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/Commenting/TestsHaveCoversTagSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
/**
* Verifies that all test functions have at least one @covers tag.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.3.0
* @since 1.3.0
*/
class TestsHaveCoversTagSniff implements Sniff {

Expand Down
4 changes: 1 addition & 3 deletions Yoast/Sniffs/Files/FileNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
* - Files which don't contain an object structure, but do contain function declarations should
* have a "-functions" suffix.
*
* @package Yoast\YoastCS
*
* @since 0.5
* @since 0.5
*/
class FileNameSniff implements Sniff {

Expand Down
4 changes: 1 addition & 3 deletions Yoast/Sniffs/Files/TestDoublesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
* Additionally, checks that all classes in the `doubles` directory/directories
* have `Double` or `Mock` in the class name.
*
* @package Yoast\YoastCS
*
* @since 1.0.0
* @since 1.0.0
*/
class TestDoublesSniff implements Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/NamingConventions/NamespaceNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
* as well as that the levels directly translate to the (sub-)directory a file is
* placed in.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 2.0.0
* @since 2.0.0
*/
class NamespaceNameSniff implements Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/NamingConventions/ObjectNameDepthSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
/**
* Check the number of words in object names declared within a namespace.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 2.0.0
* @since 2.0.0
*/
class ObjectNameDepthSniff extends WPCS_Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/NamingConventions/ValidHookNameSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
* namespace-like prefix for hooks, the `WrongPrefix` warning should be
* changed to an error and only namespace-like prefixes should be allowed.}
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 2.0.0
* @since 2.0.0
*/
class ValidHookNameSniff extends WPCS_ValidHookNameSniff {

Expand Down
3 changes: 0 additions & 3 deletions Yoast/Sniffs/Tools/BrainMonkeyRaceConditionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
* @link https://github.com/Yoast/yoastcs/issues/264
*
* @since 2.3.0
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*/
class BrainMonkeyRaceConditionSniff extends Sniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/WhiteSpace/FunctionSpacingSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
* in the global namespace as those are often wrapped in an if clause which causes
* a fixer conflict.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.0.0
* @since 1.0.0
*/
class FunctionSpacingSniff extends Squiz_FunctionSpacingSniff {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Sniffs/Yoast/AlternativeFunctionsSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
/**
* Discourages the use of various functions and suggests (Yoast) alternatives.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 1.3.0
* @since 1.3.0
*/
class AlternativeFunctionsSniff extends AbstractFunctionRestrictionsSniff {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the CodeCoverageIgnoreDeprecated sniff.
*
* @package Yoast\YoastCS
* @since 1.1.0
*
* @since 1.1.0
*
* @covers YoastCS\Yoast\Sniffs\Commenting\CodeCoverageIgnoreDeprecatedSniff
* @covers YoastCS\Yoast\Sniffs\Commenting\CodeCoverageIgnoreDeprecatedSniff
*/
class CodeCoverageIgnoreDeprecatedUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Commenting/CoversTagUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the CoversTag sniff.
*
* @package Yoast\YoastCS
* @since 1.3.0
*
* @since 1.3.0
*
* @covers YoastCS\Yoast\Sniffs\Commenting\CoversTagSniff
* @covers YoastCS\Yoast\Sniffs\Commenting\CoversTagSniff
*/
class CoversTagUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Commenting/FileCommentUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the FileComment sniff.
*
* @package Yoast\YoastCS
* @since 1.2.0
*
* @since 1.2.0
*
* @covers YoastCS\Yoast\Sniffs\Commenting\FileCommentSniff
* @covers YoastCS\Yoast\Sniffs\Commenting\FileCommentSniff
*/
class FileCommentUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Commenting/TestsHaveCoversTagUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the TestsHaveCoversTag sniff.
*
* @package Yoast\YoastCS
* @since 1.3.0
*
* @since 1.3.0
*
* @covers YoastCS\Yoast\Sniffs\Commenting\TestsHaveCoversTagSniff
* @covers YoastCS\Yoast\Sniffs\Commenting\TestsHaveCoversTagSniff
*/
class TestsHaveCoversTagUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Files/FileNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
/**
* Unit test class for the FileName sniff.
*
* @package Yoast\YoastCS
* @since 0.5
*
* @since 0.5
*
* @covers YoastCS\Yoast\Sniffs\Files\FileNameSniff
* @covers YoastCS\Yoast\Sniffs\Files\FileNameSniff
*/
class FileNameUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Files/TestDoublesUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
/**
* Unit test class for the TestDoubles sniff.
*
* @package Yoast\YoastCS
* @since 1.0.0
*
* @since 1.0.0
*
* @covers YoastCS\Yoast\Sniffs\Files\TestDoublesSniff
* @covers YoastCS\Yoast\Sniffs\Files\TestDoublesSniff
*/
class TestDoublesUnitTest extends AbstractSniffUnitTest {

Expand Down
8 changes: 3 additions & 5 deletions Yoast/Tests/NamingConventions/NamespaceNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
/**
* Unit test class for the NamespaceName sniff.
*
* @package Yoast\YoastCS
* @since 2.0.0
*
* @since 2.0.0
*
* @covers YoastCS\Yoast\Sniffs\NamingConventions\NamespaceNameSniff
* @covers YoastCS\Yoast\Utils\CustomPrefixesTrait
* @covers YoastCS\Yoast\Sniffs\NamingConventions\NamespaceNameSniff
* @covers YoastCS\Yoast\Utils\CustomPrefixesTrait
*/
class NamespaceNameUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/NamingConventions/ObjectNameDepthUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the ObjectNameDepth sniff.
*
* @package Yoast\YoastCS
* @since 2.0.0
*
* @since 2.0.0
*
* @covers YoastCS\Yoast\Sniffs\NamingConventions\ObjectNameDepthSniff
* @covers YoastCS\Yoast\Sniffs\NamingConventions\ObjectNameDepthSniff
*/
class ObjectNameDepthUnitTest extends AbstractSniffUnitTest {

Expand Down
8 changes: 3 additions & 5 deletions Yoast/Tests/NamingConventions/ValidHookNameUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
/**
* Unit test class for the ValidHookName sniff.
*
* @package Yoast\YoastCS
* @since 2.0.0
*
* @since 2.0.0
*
* @covers YoastCS\Yoast\Sniffs\NamingConventions\ValidHookNameSniff
* @covers YoastCS\Yoast\Utils\CustomPrefixesTrait
* @covers YoastCS\Yoast\Sniffs\NamingConventions\ValidHookNameSniff
* @covers YoastCS\Yoast\Utils\CustomPrefixesTrait
*/
class ValidHookNameUnitTest extends AbstractSniffUnitTest {

Expand Down
4 changes: 2 additions & 2 deletions Yoast/Tests/Tools/BrainMonkeyRaceConditionUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/**
* Unit test class for the BrainMonkeyRaceCondition sniff.
*
* @package Yoast\YoastCS
* @since 2.3.0
*
* @covers YoastCS\Yoast\Sniffs\Tools\BrainMonkeyRaceConditionSniff
* @covers YoastCS\Yoast\Sniffs\Tools\BrainMonkeyRaceConditionSniff
*/
class BrainMonkeyRaceConditionUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/WhiteSpace/FunctionSpacingUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the FunctionSpacing sniff.
*
* @package Yoast\YoastCS
* @since 1.0.0
*
* @since 1.0.0
*
* @covers YoastCS\Yoast\Sniffs\WhiteSpace\FunctionSpacingSniff
* @covers YoastCS\Yoast\Sniffs\WhiteSpace\FunctionSpacingSniff
*/
class FunctionSpacingUnitTest extends AbstractSniffUnitTest {

Expand Down
6 changes: 2 additions & 4 deletions Yoast/Tests/Yoast/AlternativeFunctionsUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
/**
* Unit test class for the AlternativeFunctions sniff.
*
* @package Yoast\YoastCS
* @since 1.3.0
*
* @since 1.3.0
*
* @covers YoastCS\Yoast\Sniffs\Yoast\AlternativeFunctionsSniff
* @covers YoastCS\Yoast\Sniffs\Yoast\AlternativeFunctionsSniff
*/
class AlternativeFunctionsUnitTest extends AbstractSniffUnitTest {

Expand Down
5 changes: 1 addition & 4 deletions Yoast/Utils/CustomPrefixesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
* Trait to add a custom `$prefixes` property to sniffs and utility functions
* to validate the property value.
*
* @package Yoast\YoastCS
* @author Juliette Reinders Folmer
*
* @since 2.0.0
* @since 2.0.0
*/
trait CustomPrefixesTrait {

Expand Down