diff --git a/.editorconfig b/.editorconfig index 67df985..afe3531 100644 --- a/.editorconfig +++ b/.editorconfig @@ -16,3 +16,7 @@ indent_size = 2 [Makefile] indent_style = tab + +[*.md] +max_line_length = 80 + diff --git a/faros-ng/code-quality-pack/2.3/.editorconfig b/faros-ng/code-quality-pack/2.3/.editorconfig new file mode 100644 index 0000000..85ac704 --- /dev/null +++ b/faros-ng/code-quality-pack/2.3/.editorconfig @@ -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 diff --git a/faros-ng/code-quality-pack/2.3/.php-cs-fixer.dist.php b/faros-ng/code-quality-pack/2.3/.php-cs-fixer.dist.php new file mode 100644 index 0000000..aa1c7bc --- /dev/null +++ b/faros-ng/code-quality-pack/2.3/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +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 +; diff --git a/faros-ng/code-quality-pack/2.3/manifest.json b/faros-ng/code-quality-pack/2.3/manifest.json new file mode 100644 index 0000000..f8e1a13 --- /dev/null +++ b/faros-ng/code-quality-pack/2.3/manifest.json @@ -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" + ] +} diff --git a/faros-ng/code-quality-pack/2.3/phpstan.neon.dist b/faros-ng/code-quality-pack/2.3/phpstan.neon.dist new file mode 100644 index 0000000..b9635d5 --- /dev/null +++ b/faros-ng/code-quality-pack/2.3/phpstan.neon.dist @@ -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 diff --git a/faros-ng/code-quality-pack/2.3/tests/object-manager.php b/faros-ng/code-quality-pack/2.3/tests/object-manager.php new file mode 100644 index 0000000..10efd18 --- /dev/null +++ b/faros-ng/code-quality-pack/2.3/tests/object-manager.php @@ -0,0 +1,9 @@ +boot(); + +return $kernel->getContainer()->get('doctrine')->getManager();