Skip to content

Commit

Permalink
Fix CS fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Nov 29, 2024
1 parent e9f7058 commit 2d212c9
Show file tree
Hide file tree
Showing 6 changed files with 888 additions and 370 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 7.1 => 8.2
name: PHP Syntax check
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -30,6 +30,12 @@ jobs:
- name: PHP syntax checker 8.2
uses: prestashop/github-action-php-lint/8.2@master

- name: PHP syntax checker 8.3
uses: prestashop/github-action-php-lint/8.3@master

- name: PHP syntax checker 8.4
uses: prestashop/github-action-php-lint/8.4@master

# Check the PHP code follow the coding standards
php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -38,7 +44,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'

- name: Checkout
uses: actions/checkout@v3.1.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
.php_cs.cache
.php-cs-fixer.cache
10 changes: 9 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php

$config = new PrestaShop\CodingStandards\CsFixer\Config();
$psConfig = new PrestaShop\CodingStandards\CsFixer\Config();

$config = new PhpCsFixer\Config();
$config
->setUsingCache(true)
->setRiskyAllowed(true)
->setRules(array_merge($psConfig->getRules(), [
'blank_lines_before_namespace' => false,
'nullable_type_declaration_for_default_null_value' => true,
'blank_line_after_opening_tag' => false,
'linebreak_after_opening_tag' => false,
]))
->getFinder()
->in(__DIR__)
->exclude('vendor');
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
"php": ">=7.1.3"
},
"require-dev": {
"prestashop/php-dev-tools": "^4.3"
"prestashop/php-dev-tools": "^5",
"friendsofphp/php-cs-fixer": "^v3"
},
"config": {
"preferred-install": "dist",
"prepend-autoloader": false
},
"type": "prestashop-module",
"author": "PrestaShop"
}
}
Loading

0 comments on commit 2d212c9

Please sign in to comment.