Skip to content
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
4 changes: 2 additions & 2 deletions BigBite/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BigBite" namespace="BigBiteCS\BigBite" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<ruleset name="BigBite" namespace="BigBiteCS\BigBite" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<config name="encoding" value="utf-8" />
<config name="testVersion" value="8.2-" />

Expand Down Expand Up @@ -71,7 +71,7 @@
<rule ref="WordPress-VIP-Go" />

<!-- Use Big Bite's code documentation ruleset. -->
<rule ref="BigBite-Docs" />
<rule ref="BigBiteDocs" />

<!-- ################ -->
<!-- Additional rules -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/**
* BigBite Coding Standards.
*
* @package BigBiteCS\BigBite
* @package BigBiteCS\BigBiteDocs
* @link https://github.com/bigbite/phpcs-config
* @license https://opensource.org/licenses/MIT MIT
*/

namespace BigBiteCS\BigBite\Sniffs\Commenting;
namespace BigBiteCS\BigBiteDocs\Sniffs\Commenting;

use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
Expand Down
18 changes: 18 additions & 0 deletions BigBiteDocs/Tests/AbstractSniffUnitTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Unit test class for BigBite Coding Standard.
*
* @package BigBiteCS\BigBiteDocs
* @link https://github.com/bigbite/phpcs-config
* @license https://opensource.org/licenses/MIT MIT
*/

namespace BigBiteCS\BigBiteDocs\Tests;

use PHP_CodeSniffer\Tests\Standards\AbstractSniffUnitTest as PhpCsAbstractSniffUnitTest;

/**
* Unit test class for BigBite Coding Standard.
*/
abstract class AbstractSniffUnitTest extends PhpCsAbstractSniffUnitTest {
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// phpcs:set BigBite.Commenting.DocCommentLineLength lineLimit 120
// phpcs:set BigBite.Commenting.DocCommentLineLength absoluteLineLimit 150
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength lineLimit 120
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength absoluteLineLimit 150

/**
* This is a comment line that exceeds the default of 80 characters, but is shorter than the configured 120 characters.
Expand All @@ -15,5 +15,5 @@
* This is a comment line that exceeds the default maximum of 100 characters, and is longer than the configured maximum of 150 characters, so should trigger an error.
*/

// phpcs:set BigBite.Commenting.DocCommentLineLength lineLimit 80
// phpcs:set BigBite.Commenting.DocCommentLineLength absoluteLineLimit 100
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength lineLimit 80
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength absoluteLineLimit 100
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// phpcs:set BigBite.Commenting.DocCommentLineLength absoluteLineLimit 90
// phpcs:set BigBite.Commenting.DocCommentLineLength includeIndentation true
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength absoluteLineLimit 90
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength includeIndentation true

/**
* This is a comment line that should trigger a warning.
Expand All @@ -11,5 +11,5 @@
* This is a comment line that should trigger an error due to this config setting.
*/

// phpcs:set BigBite.Commenting.DocCommentLineLength absoluteLineLimit 90
// phpcs:set BigBite.Commenting.DocCommentLineLength includeIndentation false
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength absoluteLineLimit 90
// phpcs:set BigBiteDocs.Commenting.DocCommentLineLength includeIndentation false
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
/**
* Unit test class for BigBite Coding Standard.
*
* @package BigBiteCS\BigBite
* @package BigBiteCS\BigBiteDocs
* @link https://github.com/bigbite/phpcs-config
* @license https://opensource.org/licenses/MIT MIT
*/

namespace BigBiteCS\BigBite\Tests\Commenting;
namespace BigBiteCS\BigBiteDocs\Tests\Commenting;

use BigBiteCS\BigBite\Tests\AbstractSniffUnitTest;
use BigBiteCS\BigBiteDocs\Tests\AbstractSniffUnitTest;

/**
* Unit test class for the DocCommentLineLength sniff.
*
* @package BigBiteCS\BigBite
* @package BigBiteCS\BigBiteDocs
*/
final class DocCommentLineLengthUnitTest extends AbstractSniffUnitTest {

Expand Down
2 changes: 1 addition & 1 deletion BigBite-Docs/ruleset.xml → BigBiteDocs/ruleset.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="BigBite-Docs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<ruleset name="BigBiteDocs" namespace="BigBiteCS\BigBiteDocs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<!-- Check block comments for conformity.. -->
<rule ref="Generic.Commenting.DocComment">
<!-- Allow other tags to come before @param comments - @see, @link, etc. -->
Expand Down
3 changes: 2 additions & 1 deletion Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
}

$bigbite_standards = array(
'BigBite' => true,
'BigBite' => true,
'BigBiteDocs' => true,
);

$all_standards = PHP_CodeSniffer\Util\Standards::getInstalledStandards();
Expand Down
11 changes: 7 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"prefer-stable" : true,
"minimum-stability": "dev",
"non-feature-branches": ["chore/*", "hotfix/*"],
"non-feature-branches": ["chore/*", "hotfix/*", "fix/*"],
"authors": [
{
"name": "Paul Taylor",
Expand Down Expand Up @@ -66,16 +66,19 @@
"@php ./vendor/squizlabs/php_codesniffer/bin/phpcs ."
],
"test": [
"@php ./vendor/bin/phpunit --filter BigBite ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
"@php ./vendor/bin/phpunit --filter BigBite ./vendor/squizlabs/php_codesniffer/tests/AllTests.php",
"@php ./vendor/bin/phpunit --filter BigBiteDocs ./vendor/squizlabs/php_codesniffer/tests/AllTests.php"
],
"analyse": [
"./vendor/bin/phpstan"
],
"is-complete": [
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./BigBite"
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./BigBite",
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness -q ./BigBiteDocs"
],
"is-complete-strict": [
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./BigBite"
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./BigBite",
"@php ./vendor/phpcsstandards/phpcsdevtools/bin/phpcs-check-feature-completeness ./BigBiteDocs"
],
"all-checks": [
"@lint",
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
<testsuite name="BigBite">
<directory suffix="UnitTest.php">./BigBite/Tests/</directory>
</testsuite>
<testsuite name="BigBiteDocs">
<directory suffix="UnitTest.php">./BigBiteDocs/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>