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

Add setlist #115

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ composer require --dev lmc/coding-standard
```php
<?php declare(strict_types=1);

use Lmc\CodingStandard\Set\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
->withPaths([__DIR__ . '/src', __DIR__ . '/tests']) // optionally add 'config' or other directories with PHP files
->withRootFiles() // to also check ecs.php and all other php files in the root directory
->withSets(
[
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
SetList::ALMACAREER,
]
);
```
Expand Down Expand Up @@ -67,6 +68,7 @@ Below find examples of some more opinionated checks you may want to add dependin
```php
<?php declare(strict_types=1);

use Lmc\CodingStandard\Set\SetList;
use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestAnnotationFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
Expand All @@ -75,7 +77,7 @@ return ECSConfig::configure()
/* (...) */
->withSets(
[
__DIR__ . '/vendor/lmc/coding-standard/ecs.php',
SetList::ALMACAREER,
]
)
->withRules(
Expand Down
11 changes: 11 additions & 0 deletions src/Set/SetList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);

namespace Lmc\CodingStandard\Set;

class SetList
{
/**
* @var string
*/
public const ALMACAREER = __DIR__ . '/../../ecs.php';
}