-
-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Sniffs in PHP_CodeSniffer should preferably be accompanied by documentation. There are currently still a number of sniffs which don't have documentation.
Sniff documentation is provided via XML files in the standard's Docs
directory and is available to end-users via the command-line and/or can be compiled into an HTML or Markdown file.
To see an example of some of some available documentation, run:
phpcs --standard=PSR12 --generator=Text
Getting started
The CONTRIBUTING doc contains information on writing sniff documentation and guidelines which should be followed.
Action list
Blocked
PSR12.Files.DeclareStatement
(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Declare Statement #187)
Note: this one is blocked until the sniff rewrite has been finished & merged.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
To Do
Generic.VersionControl.GitMergeConflict
PSR12.Classes.AnonClassDeclaration
(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Anonymous Class Declaration #167)PSR12.Files.FileHeader
(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - File Header #231)PSR12.Traits.UseDeclaration
(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Use Declaration #239)Squiz.Commenting.ClassComment
Squiz.Commenting.ClosingDeclarationComment
Squiz.Commenting.EmptyCatchComment
Squiz.Commenting.FileComment
Squiz.Commenting.FunctionComment
Squiz.Commenting.InlineComment
Squiz.Commenting.LongConditionClosingComment
Squiz.Commenting.PostStatementComment
Squiz.Commenting.VariableComment
Squiz.ControlStructures.ControlSignature
Squiz.ControlStructures.ElseIfDeclaration
Squiz.ControlStructures.InlineIfDeclaration
Squiz.ControlStructures.SwitchDeclaration
Squiz.Files.FileExtension
Squiz.Formatting.OperatorBracket
Squiz.Functions.FunctionDeclarationArgumentSpacing
Squiz.Functions.FunctionDuplicateArgument
Squiz.Functions.FunctionDeclaration
Squiz.Functions.GlobalFunction
Squiz.Functions.MultiLineFunctionDeclaration
Squiz.NamingConventions.ValidFunctionName
Squiz.NamingConventions.ValidVariableName
Squiz.Objects.ObjectInstantiation
Squiz.Operators.ComparisonOperatorUsage
Squiz.Operators.IncrementDecrementUsage
Squiz.Operators.ValidLogicalOperators
Squiz.PHP.CommentedOutCode
Squiz.PHP.DisallowBooleanStatement
Squiz.PHP.DisallowComparisonAssignment
Squiz.PHP.DisallowInlineIf
Squiz.PHP.DisallowMultipleAssignments
Squiz.PHP.DisallowSizeFunctionsInLoops
Squiz.PHP.DiscouragedFunctions
Squiz.PHP.EmbeddedPhp
Squiz.PHP.Eval
Squiz.PHP.GlobalKeyword
Squiz.PHP.InnerFunctions
Squiz.PHP.LowercasePHPFunctions
Squiz.PHP.NonExecutableCode
Squiz.Scope.MemberVarScope
Squiz.Scope.MethodScope
Squiz.Strings.ConcatenationSpacing
Squiz.Strings.DoubleQuoteUsage
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Note: a number of sniffs will be removed in v 4.0. Those have been deliberately excluded from the above action list.
Claimed/Work in Progress
Squiz.Classes.ClassDeclaration
- @braindawg [Docs] Add XML doc for Squiz.Classes.ClassDeclaration sniff #844Squiz.WhiteSpace.ControlStructureSpacing
- @jaymcpSquiz.WhiteSpace.LogicalOperatorSpacing
- @jaymcpSquiz.WhiteSpace.OperatorSpacing
- @jaymcpTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Done
Generic.CodeAnalysis.EmptyPHPStatement
- @rodrigoprimo Generic/EmptyPHPStatement: add XML documentation #166Generic.Formatting.SpaceBeforeCast
- @rodrigoprimo Add documentation for the SpaceBeforeCast sniff #159Generic.PHP.RequireStrictTypes
- @rodrigoprimo Generic/RequireStrictTypes: add XML documentation #236Generic.WhiteSpace.IncrementDecrementSpacing
- @rodrigoprimo Generic/IncrementDecrementSpacing: add XML documentation #287Generic.WhiteSpace.LanguageConstructSpacing
- @rodrigoprimo Generic/LanguageConstructSpacing: add XML documentation #177PSR12.ControlStructures.BooleanOperatorPlacement
- @dingo-d [Documentation] PSR12 - Boolean Operator Placement #181PSR12.ControlStructures.ControlStructureSpacing
- @dingo-d [Documentation] PSR12 - Control Structure Spacing #182PSR12.Functions.ReturnTypeDeclaration
- @dingo-d [Documentation] PSR12 - Return Type Declaration #237Squiz.Commenting.BlockComment
- @costdev [Docs] Add XML doc for Squiz.Commenting.BlockComment sniff #848Squiz.Classes.ClassFileName
- @braindawg [Docs] Add XML doc for Squiz.Classes.ClassFileName sniff #843Squiz.Classes.ValidClassName
- @braindawg [Docs] Add XML doc for Squiz.Classes.ValidClassName sniff #842Squiz.WhiteSpace.FunctionClosingBraceSpace
- @przemekhernik [Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace #408To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Want to contribute ?
Leave a comment below to claim a sniff you'll be working on.
PRs related to this task should preferably only contain the docs for one sniff each.
Activity
rodrigoprimo commentedon Dec 12, 2023
@jrfnl, I can help with this issue. I will start with the
Generic.Formatting.SpaceBeforeCast
sniff and, if all goes well, I can create PRs for more sniffs. I will make sure to create one PR per sniff.Should we document the options that a given sniff supports? If so, how? For example, the
Generic.Arrays.ArrayIndent
supportsindent
, but I'm not sure how to document it by checking the instructions in CONTRIBUTING.md, and I was also not able to find any examples checking a few of the sniffs that are already documented.jrfnl commentedon Dec 12, 2023
Based on precedent in this repo, the documentation should outline the default behaviour of the sniff.
In docs for some external sniffs, I've sometimes mentioned that the behaviour is adjustable via properties, but I don't think that is done anywhere in this repo, so for now, I would leave it out. The wiki contains a page with details on all customisable properties anyhow.
This can be revisited at a later point in time, but for now, getting the initial version of the docs in is more important.
rodrigoprimo commentedon Dec 12, 2023
Sounds good to me. Thanks for the additional details.
rodrigoprimo commentedon Dec 14, 2023
@jrfnl, in the next few days, I can create PRs to add documentation to the
Generic
sniffs that are missing docs.(please let me know if you prefer that I claim one sniff at a time instead of claiming a group of sniffs as I'm doing here)
jrfnl commentedon Dec 14, 2023
Great! Moved those to "claimed" now. Just make sure you submit each doc as a separate PR (but you knew that already).
dingo-d commentedon Dec 15, 2023
I could take the PSR12 ones 👍🏼
jrfnl commentedon Dec 15, 2023
Moved to "Claimed" 👍🏻
44 remaining items