From 27054ef4fdf76664e2d207216e13f54353bb9ab9 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Sun, 19 Jun 2022 18:42:51 +0300 Subject: [PATCH] feat: add rules for trailing commas in function declarations --- Makefile | 4 ++-- lib/Doctrine/ruleset.xml | 8 ++++++++ tests/fixed/TralingCommaOnFunctions.php | 17 +++++++++++++++++ tests/input/TralingCommaOnFunctions.php | 17 +++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 tests/fixed/TralingCommaOnFunctions.php create mode 100644 tests/input/TralingCommaOnFunctions.php diff --git a/Makefile b/Makefile index 7c6c5c69..95c866ff 100644 --- a/Makefile +++ b/Makefile @@ -21,14 +21,14 @@ update-compatibility-patch-74: @git apply tests/php74-compatibility.patch @printf "Please open your editor and apply your changes\n" @until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved= - @git diff -- tests/expected_report.txt tests/fixed > .tmp-patch && mv .tmp-patch tests/php74-compatibility.patch && git apply -R tests/php74-compatibility.patch + @git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch && mv .tmp-patch tests/php74-compatibility.patch && git apply -R tests/php74-compatibility.patch @git commit -m 'Update compatibility patch' tests/php74-compatibility.patch update-compatibility-patch-80: @git apply tests/php80-compatibility.patch @printf "Please open your editor and apply your changes\n" @until [ "$${compatibility_resolved}" == "y" ]; do read -p "Have finished your changes (y|n)? " compatibility_resolved; done && compatibility_resolved= - @git diff -- tests/expected_report.txt tests/fixed > .tmp-patch-80 && mv .tmp-patch-80 tests/php80-compatibility.patch && git apply -R tests/php80-compatibility.patch + @git diff -- tests/expected_report.txt tests/fixed tests/input > .tmp-patch-80 && mv .tmp-patch-80 tests/php80-compatibility.patch && git apply -R tests/php80-compatibility.patch @git commit -m 'Update compatibility patch' tests/php80-compatibility.patch vendor: composer.json diff --git a/lib/Doctrine/ruleset.xml b/lib/Doctrine/ruleset.xml index ae7ca301..b4a65632 100644 --- a/lib/Doctrine/ruleset.xml +++ b/lib/Doctrine/ruleset.xml @@ -284,6 +284,14 @@ + + + + + + + + diff --git a/tests/fixed/TralingCommaOnFunctions.php b/tests/fixed/TralingCommaOnFunctions.php new file mode 100644 index 00000000..ed304c9f --- /dev/null +++ b/tests/fixed/TralingCommaOnFunctions.php @@ -0,0 +1,17 @@ +