-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from tr33m4n/feature/maintenance
General maintenance
- Loading branch information
Showing
8 changed files
with
168 additions
and
26 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,36 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
- cron: 0 3 * * 1,3,5 | ||
workflow_dispatch: | ||
|
||
env: | ||
COMPOSER_MEMORY_LIMIT: -1 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: [ 8.1, 8.2, 8.3 ] | ||
fail-fast: false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
- name: Install dependencies | ||
run: | | ||
composer config --global --auth http-basic.repo.magento.com ${{ secrets.MAGENTO_REPO_USERNAME }} ${{ secrets.MAGENTO_REPO_PASSWORD }} | ||
sudo chmod 644 ~/.composer/auth.json | ||
composer update | ||
- name: Run static analysis test suite | ||
run: composer run test |
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,10 @@ | ||
/vendor | ||
/.php_cs.cache | ||
/var | ||
/composer.lock | ||
/app | ||
/.phpunit.cache | ||
/.editorconfig | ||
/.idea | ||
/Makefile | ||
/Brewfile |
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,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src'); | ||
|
||
$config = (new PhpCsFixer\Config()) | ||
->setUsingCache(false) | ||
->registerCustomFixers([new ForceFQCNFixer()]) | ||
->setFinder($finder) | ||
->setRules( | ||
[ | ||
'@PSR2' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'concat_space' => ['spacing' => 'one'], | ||
'include' => true, | ||
'new_with_braces' => true, | ||
'no_empty_statement' => true, | ||
'no_leading_import_slash' => true, | ||
'no_leading_namespace_whitespace' => true, | ||
'no_multiline_whitespace_around_double_arrow' => true, | ||
'multiline_whitespace_before_semicolons' => true, | ||
'no_singleline_whitespace_before_semicolons' => true, | ||
'no_trailing_comma_in_singleline_array' => true, | ||
'no_unused_imports' => true, | ||
'no_whitespace_in_blank_line' => true, | ||
'object_operator_without_whitespace' => true, | ||
'ordered_imports' => true, | ||
'standardize_not_equals' => true, | ||
'ternary_operator_spaces' => true, | ||
'AdamWojs/phpdoc_force_fqcn_fixer' => true | ||
] | ||
); | ||
|
||
return $config; |
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 |
---|---|---|
|
@@ -9,7 +9,15 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true, | ||
"phpstan/extension-installer": true | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"files": [ | ||
"src/registration.php" | ||
|
@@ -19,7 +27,31 @@ | |
} | ||
}, | ||
"require": { | ||
"php": "^7.2", | ||
"magento/framework": "^100.1||^101.0||^102.0" | ||
"php": "^8.1", | ||
"magento/framework": "*" | ||
}, | ||
"scripts": { | ||
"fix": "vendor/bin/rector process && vendor/bin/php-cs-fixer fix --diff", | ||
"test:static": "vendor/bin/phpstan analyse --no-interaction --no-progress && vendor/bin/phpcs src -s", | ||
"test:lint": "vendor/bin/rector process --dry-run && vendor/bin/php-cs-fixer fix --dry-run --diff", | ||
"test-static-analysis": [ | ||
"@test:static", | ||
"@test:lint" | ||
], | ||
"test": [ | ||
"@test-static-analysis" | ||
] | ||
}, | ||
"require-dev": { | ||
"adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0", | ||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0", | ||
"friendsofphp/php-cs-fixer": "^3.62", | ||
"phpstan/extension-installer": "^1.4", | ||
"phpstan/phpstan": "^1.11", | ||
"phpunit/phpunit": "^10.5", | ||
"rector/rector": "^1.2" | ||
}, | ||
"extra": { | ||
"magento-deploystrategy": "none" | ||
} | ||
} |
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,7 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="PHP_CodeSniffer"> | ||
<description>tr33m4n system path hints configuration</description> | ||
<rule ref="PSR12"> | ||
<exclude name="Generic.Files.LineLength"/> | ||
</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,12 @@ | ||
parameters: | ||
paths: | ||
- %currentWorkingDirectory%/src | ||
excludePaths: | ||
- *Test* | ||
- *tests* | ||
level: max | ||
ignoreErrors: | ||
- '#Method (.*) should return class-string but returns string.#' | ||
- '#PHPDoc tag @var for constant (.*) with type class-string is incompatible with value (.*)#' | ||
- '#Default value of the parameter (.*) of method (.*) is incompatible with type class-string.#' | ||
- '#Default value of the parameter (.*) of method (.*) is incompatible with type array<class-string>.#' |
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Caching\ValueObject\Storage\MemoryCacheStorage; | ||
use Rector\Config\RectorConfig; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->import(SetList::DEAD_CODE); | ||
$rectorConfig->import(SetList::NAMING); | ||
$rectorConfig->import(SetList::EARLY_RETURN); | ||
$rectorConfig->import(SetList::CODE_QUALITY); | ||
$rectorConfig->import(SetList::PRIVATIZATION); | ||
$rectorConfig->import(SetList::TYPE_DECLARATION); | ||
$rectorConfig->import(LevelSetList::UP_TO_PHP_81); | ||
|
||
$rectorConfig->cacheClass(MemoryCacheStorage::class); | ||
|
||
$rectorConfig->paths([__DIR__ . '/src']); | ||
$rectorConfig->skip([ | ||
__DIR__ . '/src/Test' | ||
]); | ||
}; |
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