rector/ecs.yaml

159 lines
8.0 KiB
YAML

imports:
- { resource: 'vendor/symplify/easy-coding-standard/config/set/psr12.yaml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/set/php71.yaml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/set/symplify.yaml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/set/common.yaml' }
- { resource: 'vendor/symplify/easy-coding-standard/config/set/clean-code.yaml' }
services:
Symplify\CodingStandard\Sniffs\CleanCode\CognitiveComplexitySniff:
max_cognitive_complexity: 9
Symplify\CodingStandard\Fixer\Order\MethodOrderByTypeFixer:
method_order_by_type:
Rector\Contract\Rector\PhpRectorInterface:
- 'getDefinition'
- 'getNodeTypes'
- 'refactor'
Symplify\CodingStandard\Fixer\Naming\PropertyNameMatchingTypeFixer:
extra_skipped_classes:
- 'PhpParser\PrettyPrinter\Standard'
- '?string' # bug probably
Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
extra_parent_types_to_suffixes:
- 'Rector'
- 'NodeVisitorAbstract'
parameters:
exclude_files:
- '*tests/**Source/*.php'
# tests files
- '*tests/*/Fixture/*'
- '*tests/*/Expected/*'
- '*utils/ContributorTools/templates/*'
- 'stubs/*'
- '*/Expected/*'
# exclude
- 'src/Rector/AbstractRector.php'
- 'src/PhpParser/BetterNodeDumper.php'
skip:
# rather useless
Symplify\CodingStandard\Sniffs\DependencyInjection\NoClassInstantiationSniff: ~
PhpCsFixer\Fixer\Import\GlobalNamespaceImportFixer: ~
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer: ~
PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff.Underscore: ~
Symplify\CodingStandard\Sniffs\Architecture\DuplicatedClassShortNameSniff: ~
# skip temporary due to missing "import" feature in PhpStorm
SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff.PartialUse: ~
# run manually from time to time - performance demanding + not to bother user with it
Symplify\CodingStandard\Fixer\Order\PropertyOrderByComplexityFixer: ~
Symplify\CodingStandard\Fixer\Order\PrivateMethodOrderByUseFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer:
- 'packages/Php74/src/Rector/Double/RealToFloatTypeCastRector.php'
Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenReferenceSniff: ~
Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff:
- 'src/Util/*.php'
- 'packages/BetterPhpDocParser/src/Annotation/AnnotationNaming.php'
- 'src/Testing/PHPUnit/PHPUnitEnvironment.php'
# honesty first
- 'src/*Static*.php'
Symplify\CodingStandard\Fixer\Naming\PropertyNameMatchingTypeFixer:
- 'packages/NodeTypeResolver/src/PHPStan/Scope/NodeScopeResolver.php'
- 'compiler/src/*'
Symplify\CodingStandard\Sniffs\Naming\ClassNameSuffixByParentSniff:
# hidden API
- 'src/Rector/AbstractRector.php'
Symplify\CodingStandard\Sniffs\CleanCode\CognitiveComplexitySniff:
# solve later
- 'src/Console/Command/ScreenFileCommand.php'
- 'packages/Doctrine/src/Rector/ClassMethod/AddMethodCallBasedParamTypeRector.php'
- 'packages/TypeDeclaration/src/TypeInferer/ReturnTypeInferer/ReturnedNodesReturnTypeInferer.php'
- 'packages/NodeTypeResolver/src/NodeTypeResolver.php'
- 'packages/NodeTypeResolver/src/PerNodeTypeResolver/VariableTypeResolver.php'
- 'packages/Php71/src/Rector/FuncCall/RemoveExtraParametersRector.php'
- 'packages/SOLID/src/Analyzer/ClassConstantFetchAnalyzer.php'
# tough logic
- 'packages/CodingStyle/src/Imports/ImportSkipper.php'
- 'packages/PHPUnit/src/Rector/Class_/ArrayArgumentInTestToDataProviderRector.php'
- 'packages/BetterPhpDocParser/src/Ast/PhpDoc/*/*TagValueNode.php'
- 'packages/NodeTypeResolver/src/PhpDoc/NodeAnalyzer/FqnNamePhpDocNodeDecorator.php'
- 'packages/NodeTypeResolver/src/PHPStan/Type/StaticTypeAnalyzer.php'
- 'src/NodeContainer/ParsedNodesByType.php'
- 'packages/NodeTypeResolver/src/StaticTypeMapper.php'
- 'packages/PHPStan/src/Rector/Node/RemoveNonExistingVarAnnotationRector.php'
- 'packages/Architecture/src/Rector/Class_/ConstructorInjectionToActionInjectionRector.php'
- 'src/PhpParser/Node/Commander/NodeRemovingCommander.php'
- 'packages/BetterPhpDocParser/src/*'
- 'packages/Symfony/src/Rector/Class_/MakeCommandLazyRector.php'
- 'packages/Legacy/src/Rector/ClassMethod/ChangeSingletonToServiceRector.php'
- 'src/Rector/Psr4/MultipleClassFileToPsr4ClassesRector.php'
- 'src/PhpParser/Node/Resolver/NameResolver.php'
- 'src/Rector/MethodBody/NormalToFluentRector.php'
- 'packages/CodingStyle/src/Rector/Use_/RemoveUnusedAliasRector.php'
- 'packages/NetteToSymfony/src/Route/RouteInfoFactory.php'
- 'utils/*/DumpNodesCommand.php'
- 'packages/CodeQuality/src/Rector/Identical/SimplifyBoolIdenticalTrueRector.php'
- 'packages/BetterPhpDocParser/src/Attributes/Ast/AttributeAwareNodeFactory.php'
- 'packages/Laravel/src/Rector/FuncCall/HelperFunctionToConstructorInjectionRector.php'
- 'packages/PhpSpecToPHPUnit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php'
- 'packages/NetteTesterToPHPUnit/src/AssertManipulator.php'
- 'packages/Legacy/src/NodeAnalyzer/SingletonClassMethodAnalyzer.php'
- 'src/Rector/AbstractRector/ComplexRemovalTrait.php'
# aliases
- 'packages/CodingStyle/src/Rector/Namespace_/ImportFullyQualifiedNamesRector.php'
# copied 3rd party logic
- 'packages/Php70/src/EregToPcreTransformer.php'
# dev
- 'packages/TypeDeclaration/src/Rector/FunctionLike/*TypeDeclarationRector.php'
- 'packages/Php70/src/Rector/If_/IfToSpaceshipRector.php'
Symplify\CodingStandard\Sniffs\ControlStructure\SprintfOverContactSniff:
# respects inherited pattern for better comparing
- 'src/PhpParser/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'
- 'src/PhpParser/Printer/BetterStandardPrinter.php'
- 'tests/AbstractContainerAwareTestCase.php'
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff.MissingTraversableReturnTypeHintSpecification:
# false positive
- 'src/Testing/PHPUnit/AbstractRectorTestCase.php'
Symplify\CodingStandard\Sniffs\Debug\CommentedOutCodeSniff.Found:
# notes
- 'packages/Php72/src/Rector/Each/ListEachRector.php'
- 'packages/DeadCode/src/Rector/ClassMethod/RemoveOverriddenValuesRector.php'
- 'packages/PhpSpecToPHPUnit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php'
PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer:
- 'packages/BetterPhpDocParser/tests/PhpDocInfo/PhpDocInfo/PhpDocInfoTest.php'
# intentional "assertEquals()"
- 'tests/PhpParser/Node/NodeFactoryTest.php'
- '*TypeResolverTest.php'
Symplify\CodingStandard\Sniffs\Commenting\AnnotationTypeExistsSniff:
- '*PhpDocNodeFactory.php'
- '*AnnotationReader.php'
- 'compiler/src/*'
# conflicts with "PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer"
PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~
line_ending: "\n"