Repository navigation
Blink: port 15 Squiz PHP_CodeSniffer sniffs - #406
Merged
Merged
Conversation
Port ScopeKeywordSpacing, SelfMemberReference, MemberVarSpacing and FunctionSpacing, held byte-exact to ECS on the upstream test files. phpcs-fixtures.sh now runs ECS once per input: PHP_CodeSniffer's Fixer keeps its conflict history across the files of one run, which changed the ECS output of FunctionSpacingUnitTest.6.inc depending on its siblings.
…Declaration sniffs The shared PHP_CodeSniffer operator context no longer reads a closure's return type colon inside a ternary as the ternary's else.
FileComment, InlineComment, LongConditionClosingComment and VariableComment, with upstream fixtures matching ECS byte for byte.
…pin FileComment clock, refresh counts
FunctionClosingBraceSpace, LowercasePHPFunctions, ConcatenationSpacing and InlineIfDeclaration, byte-exact against ECS on the upstream fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth wave of PHP_CodeSniffer ports, Squiz only (the PSR2/PSR12/PEAR ones landed in #405). Every sniff passes PHP_CodeSniffer's own test files byte-exact against ECS output (
TestPhpcsUpstreamFixtures), and extra edge cases were run throughbin/ecsvsbin/ecs --blinkwith identical output.New sniffs
ScopeKeywordSpacing,MemberVarSpacing,FunctionSpacing,OperatorSpacing,FunctionClosingBraceSpaceSelfMemberReferenceForEachLoopDeclaration,ForLoopDeclaration,InlineIfDeclarationFileComment,InlineComment,LongConditionClosingComment,VariableCommentLowercasePHPFunctions,ConcatenationSpacingNotes
LowercasePHPFunctionsuses a committed list of PHP's built-in functions (php_builtin_functions.txt, from PHP 8.4 with bundled extensions; regenerate withbin/php-builtin-functions.sh). Upstream reads the running PHP, so functions from extra extensions can differOperatorSpacingcopies PHP_CodeSniffer's rule that stops a pass when a fix would undo the previous one - an&right after a//comment never settles otherwiseFileCommentfills a missing copyright year from the clock; the fixtures embed the generation year, so tests pin the clock (file_comment_clock_test.go)slvFilehelpers clashed by name with Blink: port 21 PSR2, PSR12 and PEAR PHP_CodeSniffer sniffs #405's and do different things, so this side renamed them (isScopeOrMethodModifier,isAnonClassKeyword,docBlockOpener)TestOperatorLinebreakKeepsNullFirstParenAssignmentruns every rule, so its expected output gains the blank linesFunctionSpacingandFunctionClosingBraceSpaceadd; the null-first assertion is unchangedNot ported, still listed
MultiLineFunctionDeclaration- builds on PEARFunctionDeclarationfrom Blink: port 21 PSR2, PSR12 and PEAR PHP_CodeSniffer sniffs #405, next wavePHP_CodeSniffer coverage: 86 -> 101 of 114,
phpcs-not-ported.txt28 -> 13.