Closed SebSept closed 2 years ago
I never succeeded with the $config = new PrestaShop\CodingStandards\CsFixer\Config();
With some things like that works well.
<?php
declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
->notPath('resources')
;
$config = new PhpCsFixer\Config();
$config->setRiskyAllowed(true);
return $config
->setRules([
'@Symfony' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => file_get_contents(__DIR__.'/licence/licence_header.txt'),
'location' => 'after_open',
'separate' => 'bottom'
],
'concat_space' => [
'spacing' => 'one',
],
'cast_spaces' => [
'space' => 'single',
],
'error_suppression' => [
'mute_deprecation_error' => false,
'noise_remaining_usages' => false,
'noise_remaining_usages_exclude' => [],
],
'function_to_constant' => false,
'no_alias_functions' => false,
'non_printable_character' => false,
'phpdoc_summary' => false,
'phpdoc_align' => [
'align' => 'left',
],
'protected_to_private' => false,
'psr4' => false,
'self_accessor' => false,
'yoda_style' => null,
'non_printable_character' => true,
'no_superfluous_phpdoc_tags' => false,
])
->setFinder($finder)
;
https://github.com/friends-of-presta/fop_console/compare/dev...okom3pom:header-stamp?expand=1
.php-cs-fixer.dist.php is for my own test with csfixer 3 i can remove it
We can inherit PrestaShop\CodingStandards\CsFixer\Config and add rules with an anonymous class. I'm pushing a PR ...
There is a rule to add a banner. It works well. but the .php_cs.dist file need some changes to support it.
I can do it later, or someone before, no matter.