diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd0eaf3..e4f6f5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,22 @@ In following snippet, you will have to replace `YOURFORK` and `YOURBRANCH` with These commands can be used to test it out: +### Change the recipes.php file + +If you want to test a specific branch, you have to add it as a version to `recipes.php`. +You could also use the wildcard version: + +```php +return [ + 'phpro/symfony-conventions' => [ + '*' => [ + 'configs/grumphp.yaml' => 'grumphp.yaml.dist', + 'configs/.php-cs-fixer.php' => '.php-cs-fixer.php', + ], + ], +]; +``` + ### Rebuild the recipes and index: ```bash FLEX_BRANCH=YOURBRANCH FLEX_FORK=YOURFORK php scripts/build-flex.php diff --git a/index.json b/index.json index 904bc7d..c10607b 100644 --- a/index.json +++ b/index.json @@ -2,7 +2,6 @@ "WARNING": "This file is auto-generated and may only be changed by computers!", "recipes": { "phpro/symfony-conventions": [ - "*", "1.0" ], "phpstan/phpstan": [ @@ -12,11 +11,11 @@ "4.22" ] }, - "branch": "master", + "branch": "main", "is_contrib": true, "_links": { "repository": "github.com/phpro/symfony-conventions", - "origin_template": "{package}:{version}@github.com/phpro/symfony-conventions:master", - "recipe_template": "https://api.github.com/repos/phpro/symfony-conventions/contents/recipes/{package_dotted}.{version}.json?ref=master" + "origin_template": "{package}:{version}@github.com/phpro/symfony-conventions:main", + "recipe_template": "https://api.github.com/repos/phpro/symfony-conventions/contents/recipes/{package_dotted}.{version}.json?ref=main" } } \ No newline at end of file diff --git a/recipes.php b/recipes.php index d4e6f65..cbf7bf7 100644 --- a/recipes.php +++ b/recipes.php @@ -2,10 +2,14 @@ return [ 'phpro/symfony-conventions' => [ + /* + * In case you want to test branches: + * '*' => [ 'configs/grumphp.yaml' => 'grumphp.yaml.dist', 'configs/.php-cs-fixer.php' => '.php-cs-fixer.php', ], + */ '1.0' => [ 'configs/grumphp.yaml' => 'grumphp.yaml.dist', 'configs/.php-cs-fixer.php' => '.php-cs-fixer.php', diff --git a/recipes/phpro.symfony-conventions.*.json b/recipes/phpro.symfony-conventions.*.json deleted file mode 100644 index baa0d71..0000000 --- a/recipes/phpro.symfony-conventions.*.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "WARNING": "This file is auto-generated and may only be changed by computers!", - "manifests": { - "phpro/symfony-conventions": { - "manifest": { - "copy-from-recipe": { - "configs/grumphp.yaml": "grumphp.yaml.dist", - "configs/.php-cs-fixer.php": ".php-cs-fixer.php" - } - }, - "files": { - "configs/grumphp.yaml": { - "contents": [ - "imports:", - " - { resource: vendor/phpro/symfony-conventions/grumphp-convention.yml }", - "parameters:", - " # Project preferences", - " commit_project_names: \"(A|B|C)\" # The prefix(es) of the jira project.", - " run_phpstan: false # Enable after installing the phpstan preset", - " run_psalm: false # Enable after installing the psalm preset", - " run_security_advisories: false # Enable after installing the security advisories preset", - "", - " # Personal preferences", - " stop_on_first_failure: false", - "" - ], - "executable": false - }, - "configs/.php-cs-fixer.php": { - "contents": [ - "setFinder(", - " (new PhpCsFixer\\Finder())", - " ->in([", - " getcwd().'/src',", - " getcwd().'/tests',", - " ])", - " ->exclude([", - " 'var',", - " 'migrations/*',", - " ])", - " )", - " ->setRiskyAllowed(true)", - " ->setRules([", - " '@PSR12' => true,", - " '@Symfony' => true,", - " 'align_multiline_comment' => true,", - " 'array_indentation' => true,", - " 'blank_line_after_opening_tag' => true,", - " 'combine_consecutive_issets' => true,", - " 'combine_consecutive_unsets' => true,", - " 'comment_to_phpdoc' => true,", - " 'date_time_immutable' => true,", - " 'declare_strict_types' => true,", - " 'doctrine_annotation_array_assignment' => true,", - " 'doctrine_annotation_braces' => true,", - " 'doctrine_annotation_indentation' => true,", - " 'doctrine_annotation_spaces' => true,", - " 'escape_implicit_backslashes' => true,", - " 'explicit_indirect_variable' => true,", - " 'explicit_string_variable' => true,", - " 'final_internal_class' => false,", - " 'general_phpdoc_annotation_remove' => false,", - " 'header_comment' => false,", - " 'heredoc_to_nowdoc' => false,", - " 'linebreak_after_opening_tag' => true,", - " 'list_syntax' => ['syntax' => 'short'],", - " 'mb_str_functions' => true,", - " 'method_chaining_indentation' => true,", - " 'multiline_comment_opening_closing' => true,", - " 'multiline_whitespace_before_semicolons' => true,", - " 'native_function_invocation' => false,", - " 'no_alias_functions' => true,", - " 'no_blank_lines_before_namespace' => false,", - " 'no_extra_blank_lines' => true,", - " 'no_null_property_initialization' => true,", - " 'no_php4_constructor' => true,", - " 'no_superfluous_elseif' => true,", - " 'no_superfluous_phpdoc_tags' => false,", - " 'no_unreachable_default_argument_value' => true,", - " 'no_useless_else' => true,", - " 'no_useless_return' => true,", - " 'not_operator_with_space' => false,", - " 'not_operator_with_successor_space' => false,", - " 'ordered_class_elements' => false,", - " 'php_unit_dedicate_assert' => false,", - " 'php_unit_expectation' => false,", - " 'php_unit_method_casing' => ['case' =>'snake_case'],", - " 'php_unit_mock' => false,", - " 'php_unit_namespaced' => false,", - " 'php_unit_no_expectation_annotation' => false,", - " 'php_unit_set_up_tear_down_visibility' => true,", - " 'php_unit_strict' => false,", - " 'php_unit_test_annotation' => false,", - " 'php_unit_test_class_requires_covers' => false,", - " 'phpdoc_add_missing_param_annotation' => true,", - " 'phpdoc_order' => true,", - " 'phpdoc_order_by_value' => true,", - " 'phpdoc_to_return_type' => false,", - " 'phpdoc_to_comment' => false,", - " 'phpdoc_types_order' => false,", - " 'pow_to_exponentiation' => true,", - " 'psr_autoloading' => true,", - " 'random_api_migration' => false,", - " 'simplified_null_return' => false,", - " 'single_line_throw' => false,", - " 'static_lambda' => false,", - " 'strict_comparison' => true,", - " 'strict_param' => true,", - " 'string_line_ending' => true,", - " 'ternary_to_null_coalescing' => true,", - " 'void_return' => true,", - " ])", - " ;", - "" - ], - "executable": false - } - }, - "ref": "dd7925e6ba0fd1dbe6aad5dd3e3a0b86c9127da9" - } - } -} \ No newline at end of file diff --git a/scripts/build-flex.php b/scripts/build-flex.php index b5215e8..fcdd1bb 100644 --- a/scripts/build-flex.php +++ b/scripts/build-flex.php @@ -50,7 +50,7 @@ ]; -$branch = $_SERVER['FLEX_BRANCH'] ?? 'master'; +$branch = $_SERVER['FLEX_BRANCH'] ?? 'main'; $fork = $_SERVER['FLEX_FORK'] ?? 'phpro'; $buildIndex = static fn (array $recipes): array => [