Skip to content

0.5

Compare
Choose a tag to compare
@moorscode moorscode released this 24 Aug 08:04
· 748 commits to develop since this release
fad5e7c

Added

  • PHPCS: New Yoast.Files.FileName sniff and exclude the whole WordPress.Files.FileName sniff.
    The Yoast.Files.FileName sniff verifies that file names comply with the Yoast specific file name rules.
  • PHPCS: The external PHPCompatibility standard to the YoastCS ruleset at version ^8.1.0.
    Checking against this standard was previously disabled as it was incompatible with Composer. This has since been fixed.
  • PHPCS: A WP specific set of excludes for the PHPCompatibility standard to prevent false positives for native PHP functionality which is back-filled by WordPress.
  • PHPCS: A custom configuration for the new WordPress.Arrays.MultipleStatementAlignment sniff as introduced in WordPressCS 0.14.0.
  • PHPCS: An exclusion for the WordPress.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition error code.
  • PHPCS: An exclusion for the WordPress.PHP.StrictInArray.FoundNonStrictFalse error code.
  • Composer: Repository type indicator for compatibility with Composer plugins which handle the setting of the PHP_CodeSniffer installed_paths directive.
  • Composer: Suggest requiring the DealerDirect Composer PHPCS plugin, i.e. dealerdirect/phpcodesniffer-composer-installer, for handling the PHP_CodeSniffer installed_paths directive at version ^0.4.3.
  • Travis: Validation and CS check of the XML files.
  • Travis: Testing of the repo against PHP 7.2.
  • Travis: Checking of the code style of the YoastCS native PHP files.
  • Travis: Validation of the composer.json file.
  • A .gitattributes file to keep the code distributed via GH archives and Packagist clean of development related files.
  • A custom PHPCS ruleset, .phpcs.xml.dist, based on YoastCS to check the code style of the code in the YoastCS repository itself.
  • A phpunit.xml.dist file to document the PHPUnit configuration used for testing the YoastCS native sniffs.

Changed

  • The minimum supported PHP version for YoastCS is now PHP 5.4 (was 5.2).
  • Composer: Supported version of PHP_CodeSniffer has been changed from 2.8.1 to ^3.2.0.
  • Composer: Supported version of WordPressCS has been changed from ~0.10.0 to ~0.14.0.
  • PHPCS: The native YoastCS sniffs are now compatible with PHP_CodeSniffer 3.x.
  • PHPCS: Improvements to the native Yoast.ControlStructures.IfElseDeclaration sniff:
    • The sniff now has improved detection of issues when non-custom code style is used.
    • The sniff has been made more efficient and will exit earlier when no issues are or can be detected.
    • The error message has been made more descriptive.
    • The sniff will no longer hide one error behind another.
    • The sniff will no longer throw false positives when the new PHP_CodeSniffer 3.2.0 inline annotations are encountered.
  • Improved inline documentation in the PHPCS ruleset.
  • Travis: Minor tweaks to make the builds more efficient.

Removed

  • Composer: Superfluous conflict directive.
    This has been superseded by a higher minimum PHP_CodeSniffer requirement.
  • PHPCS: Support for PHP_CodeSniffer 2.x for the YoastCS native sniffs.
  • PHPCS: The exclusion of the Generic.Files.LineEndings.InvalidEOLChar error code.
  • PHPCS: The inclusion of the Generic.Strings.UnnecessaryStringConcat sniff, including custom configuration.
    This sniff is now included in WordPressCS since version 0.11.0.
  • PHPCS: The exclusion of the PEAR.Functions.FunctionCallSignature.Indent error code as code should comply with this.
  • PHPCS: The inclusion of the Squiz.ControlStructures category and the related detail configuration.
    This is now largely covered by WordPressCS 0.14.0.
  • PHPCS: The exclusion of the whole WordPress.Variables.GlobalVariables sniff.
    This sniff was previously excluded because of a bug in WordPressCS. This bug has been fixed in WordPressCS 0.11.0.
  • PHPCS: The exclusion of the WordPress.VIP.DirectDatabaseQuery, WordPress.VIP.FileSystemWritesDisallow, WordPress.XSS.EscapeOutput, WordPress.VIP.ValidatedSanitizedInput sniffs and the Generic.Commenting.DocComment.MissingShort error code.
    These kind of excludes should be handled in the plugin specific rulesets, not across the board in the YoastCS ruleset.
  • PHPCS: The group exclusion configurations for the WordPress.VIP.RestrictedFunctions, WordPress.VIP.RestrictedVariables and the WordPress.VIP.PostsPerPage sniffs.
    This kind of configuration should be handled in the plugin specific rulesets, not across the board in the YoastCS ruleset.

Fixed

  • Code style consistency for the xml files in this repository.
  • Code style consistency for the php files in this repository.
  • PHPCS: Exclusion patterns for the empty index.php files.