Skip to content

Commit

Permalink
feat(code-quality-pack): Code quality pack editorconfig line max leng…
Browse files Browse the repository at this point in the history
…th (#35)

* chore: init code-quality-pack 2.3 version from 2.2

* feat(code-quality-pack): set max_line_length in .editorconfig

* feat(code-quality-pack): respect PSR

* feat(code-quality-pack): add return

* feat(code-quality-pack): add return
  • Loading branch information
pierreboissinot authored May 21, 2024
1 parent d135ab8 commit 9ee8241
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ indent_size = 2

[Makefile]
indent_style = tab

[*.md]
max_line_length = 80

18 changes: 18 additions & 0 deletions faros-ng/code-quality-pack/2.3/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{js,json,vue,css,less,scss}]
indent_size = 2

[Makefile]
indent_style = tab

[*.md]
max_line_length = 80
29 changes: 29 additions & 0 deletions faros-ng/code-quality-pack/2.3/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/migrations')
->in(__DIR__.'/tests')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'no_unused_imports' => true,
'array_syntax' => [
'syntax' => 'short',
],
'ordered_imports' => [
'sort_algorithm' => 'alpha',
],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'phpdoc_separation' => [
'groups' => [['ORM\\*'], ['Assert\\*']],
]
])
->setFinder($finder)
->setCacheFile('.php-cs-fixer.cache') // forward compatibility with 3.x line
;
12 changes: 12 additions & 0 deletions faros-ng/code-quality-pack/2.3/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"copy-from-recipe": {
".editorconfig": ".editorconfig",
".php-cs-fixer.dist.php": ".php-cs-fixer.dist.php",
"phpstan.neon.dist": "phpstan.neon.dist",
"tests/object-manager.php": "tests/object-manager.php"
},
"gitignore": [
"phpstan.neon",
".php-cs-fixer.cache"
]
}
15 changes: 15 additions & 0 deletions faros-ng/code-quality-pack/2.3/phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Config Phpstan

parameters:
level: 5
paths:
- src
- migrations

tmpDir: var/phpstan

doctrine:
objectManagerLoader: tests/object-manager.php

symfony:
containerXmlPath: var/cache/dev/App_KernelDevDebugContainer.xml
9 changes: 9 additions & 0 deletions faros-ng/code-quality-pack/2.3/tests/object-manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

use App\Kernel;

require __DIR__.'/../config/bootstrap.php';
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel->boot();

return $kernel->getContainer()->get('doctrine')->getManager();

0 comments on commit 9ee8241

Please sign in to comment.