rector/ecs.yml
2018-10-07 19:56:07 +08:00

121 lines
5.2 KiB
YAML

imports:
- { resource: 'vendor/symplify/easy-coding-standard/config/psr2.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/php71.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/symplify.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/common.yml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/clean-code.yml' }
services:
SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff: ~
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer:
allow_classes:
- 'SomeClass' # from PHPUnit
Symplify\CodingStandard\Sniffs\CleanCode\CognitiveComplexitySniff:
maxCognitiveComplexity: 8
Symplify\CodingStandard\Fixer\Order\MethodOrderByTypeFixer:
method_order_by_type:
Rector\Contract\Rector\PhpRectorInterface:
- 'getDefinition'
- 'getNodeTypes'
- 'refactor'
Rector\YamlRector\Contract\YamlRectorInterface:
- 'getDefinition'
- 'refactor'
Symplify\CodingStandard\Sniffs\DependencyInjection\NoClassInstantiationSniff:
extraAllowedClasses:
- 'PhpParser\Node\*'
- 'Symplify\PackageBuilder\*'
- 'PhpParser\Comment\Doc'
- 'PhpParser\NodeTraverser'
- 'Rector\DeprecationExtractor\Deprecation\*'
- 'Rector\Reporting\FileDiff'
- 'Rector\RectorDefinition\*'
- 'PHPStan\Analyser\Scope'
- 'PhpParser\NodeVisitor\NameResolver'
- 'Rector\Application\Error'
- 'Rector\DependencyInjection\Loader\*'
Symplify\CodingStandard\Fixer\Naming\PropertyNameMatchingTypeFixer:
extra_skipped_classes:
- 'PhpParser\PrettyPrinter\Standard'
- 'PhpParser\Node'
Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
extraParentTypesToSuffixes:
- 'Rector'
- 'NodeVisitorAbstract'
parameters:
exclude_files:
- '*tests/*Source/*.php'
# tests files
- '*tests/*/Wrong/*'
- '*tests/*/Correct/*'
- '*tests/*/Expected/*'
skip:
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer:
# classes might not exist
- 'bin/bootstrap.php'
- '*/packages/*/src/Rector/*Rector.php'
- 'src/Rector/MethodCall/MethodCallToAnotherMethodCallWithArgumentsRector.php'
- 'src/Rector/Constant/RenameClassConstantsUseToStringsRector.php'
- '*/packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver.php'
- '*/packages/NodeTypeResolver/**/PerNodeTypeResolver/**TypeResolver/*Test.php'
- 'tests/NodeAnalyzer/ClassLikeAnalyzerTest.php'
- 'tests/NodeValueResolver/ConstExprEvaluatorFactoryTest.php'
- 'src/Rector/AbstractPHPUnitRector.php'
- 'src/Rector/Class_/ParentClassToTraitsRector.php'
# example in description
- 'src/Rector/Assign/PropertyAssignToMethodCallRector.php'
- 'src/Rector/Constant/ClassConstantReplacerRector.php'
- 'src/Rector/Property/PropertyNameReplacerRector.php'
- 'src/Rector/Annotation/AnnotationReplacerRector.php'
- 'src/Rector/Argument/ArgumentAdderRector.php'
- 'src/Rector/Form/Helper/FormTypeStringToTypeProvider.php'
# empty arguments passing
PHP_CodeSniffer\Standards\PEAR\Sniffs\Functions\ValidDefaultValueSniff.NotAtEnd:
- 'packages/PHPUnit/src/Rector/SpecificMethod/AssertTrueFalseToSpecificMethodRector.php'
Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff:
- 'src/Configuration/Rector/Guard/RecipeGuard.php'
- 'src/Configuration/Rector/*Recipe.php'
Symplify\CodingStandard\Fixer\Naming\PropertyNameMatchingTypeFixer:
- 'packages/NodeTypeResolver/src/PHPStan/Scope/NodeScopeResolver.php'
Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
# hidden API
- 'src/Rector/AbstractRector.php'
Symplify\CodingStandard\Sniffs\CleanCode\CognitiveComplexitySniff:
# tough logic
- 'src/Rector/MethodBody/NormalToFluentRector.php'
SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff.UnusedParameter:
# enforced by interface
- '*Command.php'
- '*NodeVisitor.php'
- '*CompilerPass.php'
# array type check
- 'src/RectorDefinition/RectorDefinition.php'
Symplify\CodingStandard\Sniffs\ControlStructure\SprintfOverContactSniff:
# respects inherited pattern for better comparing
- 'src/Printer/BetterStandardPrinter.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff.FoundInWhileCondition: ~
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.MissingParameterTypeHint:
# 3rd party parent code
- 'src/DependencyInjection/Loader/TolerantRectorYamlFileLoader.php'
Symplify\CodingStandard\Sniffs\Debug\CommentedOutCodeSniff.Found:
# notes
- 'packages/Php/src/Rector/Each/ListEachRector.php'