forked from rectorphp/rector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.yaml
149 lines (121 loc) · 6.35 KB
/
ecs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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:
paths:
- "bin"
- "src"
- "packages"
- "rules"
- "tests"
- "utils"
- "compiler"
sets:
- "psr12"
- "php70"
- "php71"
- "symplify"
- "common"
- "clean-code"
exclude_files:
- '*tests/**Source/*.php'
# tests files
- '*tests/*/Fixture/*'
- '*tests/*/Expected/*'
- '*utils/ContributorTools/templates/*'
- 'stubs/*'
# exclude
- 'src/Rector/AbstractRector.php'
- 'src/PhpParser/BetterNodeDumper.php'
skip:
# rather useless
Symplify\CodingStandard\Sniffs\DependencyInjection\NoClassInstantiationSniff: null
PhpCsFixer\Fixer\Import\GlobalNamespaceImportFixer: null
Symplify\CodingStandard\Fixer\Php\ClassStringToClassConstantFixer: null
PHP_CodeSniffer\Standards\PSR2\Sniffs\Methods\MethodDeclarationSniff.Underscore: null
Symplify\CodingStandard\Sniffs\Architecture\DuplicatedClassShortNameSniff: null
# run manually from time to time - performance demanding + not to bother user with it
Symplify\CodingStandard\Fixer\Order\PropertyOrderByComplexityFixer: null
Symplify\CodingStandard\Fixer\Order\PrivateMethodOrderByUseFixer: null
PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer:
- 'rules/php-74/src/Rector/Double/RealToFloatTypeCastRector.php'
Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenReferenceSniff: null
Symplify\CodingStandard\Sniffs\CleanCode\ForbiddenStaticFunctionSniff:
- 'src/Util/*.php'
- 'packages/better-php-doc-parser/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:
# todo
- "packages/node-type-resolver/src/NodeTypeResolver.php"
- "packages/better-php-doc-parser/src/Printer/OriginalSpacingRestorer.php"
# @todo split to multiple rectors
- "rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php"
- "packages/better-php-doc-parser/src/PhpDocNode/Doctrine/Property_/ColumnTagValueNode.php"
- "packages/better-php-doc-parser/src/PhpDocNode/Doctrine/Property_/JoinColumnTagValueNode.php"
- "rules/coding-style/src/Rector/ClassMethod/NewlineBeforeNewAssignSetRector.php"
# per node logic
- 'utils/documentation-generator/src/Command/DumpNodesCommand.php'
# copied 3rd party logic
- 'rules/php-70/src/EregToPcreTransformer.php'
# dev
- 'packages/type-declaration/src/Rector/FunctionLike/*TypeDeclarationRector.php'
- 'rules/php-70/src/Rector/If_/IfToSpaceshipRector.php'
Symplify\CodingStandard\Sniffs\ControlStructure\SprintfOverContactSniff:
# respects inherited pattern for better comparing
- 'src/PhpParser/Printer/BetterStandardPrinter.php'
- 'src/Rector/AbstractRector/BetterStandardPrinterTrait.php'
PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff.FoundInWhileCondition: null
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
- 'rules/php-72/src/Rector/Each/ListEachRector.php'
- 'rules/dead-code/src/Rector/ClassMethod/RemoveOverriddenValuesRector.php'
- 'rules/php-spec-to-phpunit/src/Rector/MethodCall/PhpSpecPromisesToPHPUnitAssertRector.php'
- 'rules/cakephp-to-symfony/tests/Rector/Class_/CakePHPModelToDoctrineRepositoryRector/CakePHPModelToDoctrineRepositoryRectorTest.php'
PhpCsFixer\Fixer\PhpUnit\PhpUnitStrictFixer:
- 'packages/better-php-doc-parser/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: null
PhpCsFixer\Fixer\Strict\StrictComparisonFixer:
# part of the comparison logic
- 'packages/polyfill/src/ConditionEvaluator.php'
SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff.PartialUse:
- "rules/dead-code/src/Rector/Plus/RemoveDeadZeroAndOneOperationRector.php"
- "rules/php-56/src/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector.php"
line_ending: "\n"