Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Squizlabs Commenting sniffs for Method PHPDoc #31

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions moodle/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,58 @@
</properties>
</rule>

<!-- Check phpdoc comments for functions -->
<rule ref="Squiz.Commenting.FunctionComment"/>

<!-- We do not enforce specific formatting of @params with regards spacing -->
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfterParamType">
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfterParamName">
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentAlignment">
<severity>0</severity>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentAlignmentExceeded">
<severity>0</severity>
</rule>

<!-- Parameter comments are optional, but recommended -->
<rule ref="Squiz.Commenting.FunctionComment.MissingParamComment">
<type>warning</type>
<severity>2</severity>
</rule>

<!-- Parameter comments do not need to start with a capital letter -->
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
<severity>0</severity>
</rule>

<!-- Parameter comments do not need to end with a full stop -->
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentFullStop">
<severity>0</severity>
</rule>

<!-- Type hints are optional, but strongly recommended -->
<rule ref="Squiz.Commenting.FunctionComment.TypeHintMissing">
<type>warning</type>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
<type>warning</type>
</rule>

<!--
Sadly this rule does not let you configure it to ignore missing returns if no return is present.
We do not recommend use of `@return void` but they mandate it.
-->
<rule ref="Squiz.Commenting.FunctionComment.MissingReturn">
<severity>0</severity>
</rule>


<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>

<rule ref="Squiz.Scope.MethodScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>

Expand Down