Skip to content

Commit

Permalink
Configure new phpstan version and fix phpcs config
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Nov 10, 2023
1 parent 2a866c4 commit 3c3d232
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ indent_size = 4
trim_trailing_whitespace = true

# Unix-style newlines with a newline ending every file
[*.yaml]
[{*.yml,*.yaml}]
indent_size = 2

# Tab indentation (no size specified)
Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ jobs:
make down
sleep 2
- name: Cleanup style reports
run: |
perl -pi -e 's#/var/www/test-module/#./#g;' source/test-module/tests/reports/phpstan.report.json
perl -pi -e 's#/var/www/test-module/#./#g;' source/test-module/tests/reports/phpmd.report.json
- name: Upload log artifact
if: always()
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -264,7 +269,6 @@ jobs:
codeception_twig:
needs: [ install_shop_with_module ]
if: ${{ inputs.template_engine == 'both' || inputs.template_engine == 'twig' }}
runs-on: ubuntu-latest
steps:
- name: Load current installation from cache
Expand Down Expand Up @@ -320,7 +324,7 @@ jobs:
sleep 2
sonarcloud:
needs: [ unit_integration_tests ]
needs: [ styles, unit_integration_tests ]
if: ${{ always() && inputs.report_sonarcloud }}
runs-on: ubuntu-latest
steps:
Expand All @@ -332,16 +336,29 @@ jobs:
uses: actions/download-artifact@v3
with:
name: ModuleIntegrationTestsLog-${{ inputs.php }}-${{ inputs.mysql }}-${{ inputs.template_engine }}
path: ./tests/
path: ./testsResults/

- name: Debug
- name: Download StylesLog artifacts
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: StylesLog-${{ inputs.php }}
path: ./stylesResults/

- name: Debug tests
run: |
ls -alh
cd tests
cd testsResults
ls -alh
cd source
ls -alh
- name: Debug styles
run: |
ls -alh
cd stylesResults
ls -alh
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
Expand All @@ -354,6 +371,6 @@ jobs:
-Dsonar.sources=src
-Dsonar.tests=tests
-Dsonar.sourceEncoding=UTF-8
-Dsonar.php.coverage.reportPaths=tests/coverage.xml
-Dsonar.php.coverage.reportPaths=testsResults/source/coverage.xml
-Dsonar.cpd.php.minimumTokens=25
-Dsonar.cpd.php.minimumLines=5
-Dsonar.cpd.php.minimumLines=5
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^0.12.26",
"squizlabs/php_codesniffer": "3.*",
"phpmd/phpmd": "^2.11",
"oxid-esales/oxideshop-ce": "dev-b-7.0.x",
"qossmic/deptrac-shim": "^0.24.0",
"codeception/module-rest": "*",
"codeception/module-phpbrowser": "*",
"codeception/module-db": "*"
"codeception/module-db": "*",
"phpstan/phpstan": "^1.10"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
8 changes: 8 additions & 0 deletions tests/PhpStan/phpstan-bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

/**
* Copyright © OXID eSales AG. All rights reserved.
* See LICENSE file for license details.
*/

declare(strict_types=1);
8 changes: 8 additions & 0 deletions tests/PhpStan/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
checkMissingIterableValueType: false
bootstrapFiles:
- phpstan-bootstrap.php
level: 8
scanFiles:
- ../../vendor/oxid-esales/oxideshop-ce/source/oxfunctions.php
- ../../vendor/oxid-esales/oxideshop-ce/source/overridablefunctions.php
4 changes: 0 additions & 4 deletions tests/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<!-- Paths to check -->
<file>../src/</file>
<file>./</file>
<!--
<file>../translations</file>
-->
<file>../migration</file>
<exclude-pattern>./tests/Codeception/Config</exclude-pattern>

<!-- display progress -->
Expand Down

0 comments on commit 3c3d232

Please sign in to comment.