-
-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PHPCodeSniffer to workflow (#2708)
* Mage: CS fixes * lib: CS fixes * Added PHPCS workflow * lib: CS fixes * lib\Varien: CS fixes * Added PSR12 * Fixes linefeed in docblock * Updated: workflow * Remove Eaccelerator.php * Removed empty line * CS fixes
- Loading branch information
Showing
1,991 changed files
with
14,980 additions
and
14,620 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="OpenMage Standard" namespace="OpenMage\CS\Standard"> | ||
<rule ref="PSR2"> | ||
<exclude name="Generic.Files.LineLength.TooLong"/> | ||
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/> | ||
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/> | ||
<exclude name="PSR2.Classes.ClassDeclaration.ExtendsLine"/> | ||
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/> | ||
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/> | ||
<exclude name="PSR2.Methods.MethodDeclaration.Underscore"/> | ||
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/> | ||
</rule> | ||
<rule ref="PSR12"> | ||
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine"/> | ||
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine"/> | ||
<exclude name="PSR12.ControlStructures.ControlStructureSpacing.LineIndent"/> | ||
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock"/> | ||
</rule> | ||
<!-- | ||
<rule ref="Ecg"> | ||
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed"/> | ||
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed"/> | ||
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.Found"/> | ||
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass"/> | ||
<exclude name="Generic.Commenting.Todo.TaskFound"/> | ||
<exclude name="Generic.Metrics.CyclomaticComplexity.TooHigh"/> | ||
<exclude name="Ecg.Classes.Mysql4.Found"/> | ||
<exclude name="Ecg.PHP.PrivateClassMember.PrivateClassMemberError"/> | ||
</rule> | ||
--> | ||
</ruleset> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: "PHPCodeSniffer Code Style Analyses" | ||
|
||
on: | ||
# Run on all pushes and on all pull requests. | ||
# Prevent the build from running when there are only irrelevant changes. | ||
push: | ||
paths: | ||
- '**.php' | ||
- '.github/phpcs*' | ||
- '.github/workflows/phpcs*' | ||
pull_request: | ||
paths: | ||
- '**.php' | ||
- '.github/phpcs*' | ||
- '.github/workflows/phpcs*' | ||
# Allow manually triggering the workflow. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
phpcs: | ||
runs-on: [ubuntu-latest] | ||
|
||
strategy: | ||
matrix: | ||
paths: [ | ||
'app/code/core/Mage/', | ||
'lib/Mage/', | ||
'lib/Magento/', | ||
'lib/Varien/', | ||
'app/code/community/' | ||
] | ||
|
||
name: PHPCodeSniffer ${{ matrix.paths }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate composer | ||
run: composer validate --strict | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-* | ||
|
||
- name: PHPCodeSniffer | ||
run: php vendor/bin/phpcs -s --report=full --standard=.github/phpcs-ruleset.xml ${{ matrix.paths }} | ||
continue-on-error: ${{ matrix.paths == 'app/code/community/' }} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.