-
Notifications
You must be signed in to change notification settings - Fork 3
Preview/phpcs #55
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
base: main
Are you sure you want to change the base?
Preview/phpcs #55
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
reviews: | ||
profile: "assertive" | ||
path_filters: ["**/*","*.*"] | ||
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,10 @@ | ||||||
<?php | ||||||
|
||||||
class MyCalculator | ||||||
{ | ||||||
public function add($a, $b) | ||||||
{ | ||||||
$result = $a + $b | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix syntax error: missing semicolon. There is a syntax error on line 7 where the semicolon is missing after the addition operation. This will prevent the code from executing. Apply this diff to fix the syntax error: - $result = $a + $b
+ $result = $a + $b; 📝 Committable suggestion
Suggested change
🧰 Tools🪛 phpcs (3.7.2)[ERROR] 7-7: Tabs must be used to indent lines; spaces are not allowed (Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed) [ERROR] 7-7: Operation must be bracketed (Squiz.Formatting.OperatorBracket.MissingBrackets) 🤖 Prompt for AI Agents
|
||||||
return $result; | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Strictest Coding Standards"> | ||
|
||
<!-- Description --> | ||
<description> | ||
Enforces strict coding standards by combining multiple standards and custom rules. | ||
</description> | ||
|
||
<!-- Directories and file patterns to ignore --> | ||
<exclude-pattern>vendor/*</exclude-pattern> | ||
<exclude-pattern>node_modules/*</exclude-pattern> | ||
<exclude-pattern>storage/*</exclude-pattern> | ||
<exclude-pattern>cache/*</exclude-pattern> | ||
<exclude-pattern>*.min.js</exclude-pattern> | ||
|
||
<!-- Rulesets to use (add/remove as needed) --> | ||
<rule ref="PSR12"/> | ||
<rule ref="Squiz"/> | ||
<rule ref="Generic"/> | ||
<rule ref="PEAR"/> | ||
<rule ref="Zend"/> | ||
<rule ref="MySource"/> | ||
<rule ref="PSR1"/> | ||
|
||
<!-- Optionally enable some stricter rules --> | ||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/> | ||
<rule ref="Generic.Formatting.SpaceAfterNot"/> | ||
<rule ref="Squiz.Functions.GlobalFunction"/> | ||
<rule ref="Squiz.Functions.FunctionDuplicateArgument"/> | ||
<rule ref="Squiz.Scope.MethodScope"/> | ||
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> | ||
<rule ref="Generic.PHP.ForbiddenFunctions"/> | ||
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/> | ||
|
||
<!-- Report errors as warnings for visibility, or adjust as needed --> | ||
<arg name="report" value="full"/> | ||
<arg name="colors"/> | ||
<arg name="encoding" value="utf-8"/> | ||
|
||
<!-- Extensions to check --> | ||
<fileExtensions> | ||
<extension>php</extension> | ||
<extension>inc</extension> | ||
<extension>phtml</extension> | ||
</fileExtensions> | ||
|
||
</ruleset> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix YAML formatting issues.
The static analysis tool has identified formatting issues that should be addressed:
Apply this diff to fix the formatting:
📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 3-3: too few spaces after comma
(commas)
[error] 3-3: no new line character at the end of file
(new-line-at-end-of-file)
🤖 Prompt for AI Agents