Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexcoderabbitai wants to merge3 commits intomain
base:main
Choose a base branch
Loading
frompreview/phpcs
Open
Show file tree
Hide file tree
Changes fromall 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
3 changes: 3 additions & 0 deletions.coderabbit.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
reviews:
profile: "assertive"
path_filters: ["**/*","*.*"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

⚠️ Potential issue

Fix YAML formatting issues.

The static analysis tool has identified formatting issues that should be addressed:

  1. Missing space after comma in the array
  2. Missing newline at end of file

Apply this diff to fix the formatting:

-  path_filters: ["**/*","*.*"]+  path_filters: ["**/*", "*.*"]+
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
path_filters:["**/*","*.*"]
path_filters:["**/*","*.*"]
🧰 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
In .coderabbit.yml at line 3, fix the YAML formatting by adding a space afterthe comma in the path_filters array and ensure there is a newline at the end ofthe file. This will correct the spacing issue and comply with YAML formattingstandards.

10 changes: 10 additions & 0 deletionsbad.php
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
<?php

class MyCalculator
{
public function add($a, $b)
{
$result = $a + $b

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

⚠️ Potential issue

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

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
$result =$a +$b
$result =$a +$b;
🧰 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
In bad.php at line 7, there is a missing semicolon at the end of the statementassigning $result. Add a semicolon after "$a + $b" to fix the syntax error andallow the code to execute properly.

return $result;
}
}
47 changes: 47 additions & 0 deletionsphpcs.xml
View file
Open in desktop
Original file line numberDiff line numberDiff 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>

[8]ページ先頭

©2009-2025 Movatter.jp