Skip to content

Commit

Permalink
Merge pull request #303 from greg0ire/11.0.x
Browse files Browse the repository at this point in the history
Merge 10.1.x up into 11.0.x
  • Loading branch information
ostrolucky authored Dec 11, 2022
2 parents 05c815d + 3790b91 commit 8c3c932
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 68 deletions.
24 changes: 18 additions & 6 deletions .doctrine-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,33 @@
"docsSlug": "doctrine-coding-standard",
"versions": [
{
"name": "9.0",
"branchName": "9.0.x",
"slug": "9.0",
"name": "11.0",
"branchName": "11.0.x",
"slug": "11.0",
"upcoming": true
},
{
"name": "8.2",
"branchName": "8.2.x",
"slug": "8.2",
"name": "10.0",
"branchName": "10.0.x",
"slug": "10.0",
"current": true,
"aliases": [
"current",
"stable"
]
},
{
"name": "9.0",
"branchName": "9.0.x",
"slug": "9.0",
"maintained": false
},
{
"name": "8.2",
"branchName": "8.2.x",
"slug": "8.2",
"maintained": false
},
{
"name": "8.1",
"branchName": "8.1.x",
Expand Down
41 changes: 6 additions & 35 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,9 @@ on:
jobs:
release:
name: "Git tag, release & create merge-up PR"
runs-on: "ubuntu-20.04"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@2.0.0"
secrets:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
ORGANIZATION_ADMIN_TOKEN: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

See https://www.doctrine-project.org/projects/doctrine-coding-standard/en/stable/reference/index.html#contributing
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"doctrine",
"coding",
"standard",
"dev",
"cs",
"code",
"style",
Expand All @@ -23,7 +24,7 @@
"require": {
"php": "^7.2 || ^8.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"slevomat/coding-standard": "^8.6",
"slevomat/coding-standard": "^8.6.2",
"squizlabs/php_codesniffer": "^3.7"
},
"config": {
Expand Down
34 changes: 26 additions & 8 deletions docs/en/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,24 @@ and `the list of configuration options <https://github.com/squizlabs/PHP_CodeSni

To learn about customizing the rules, please refer to the :ref:`customizing` chapter.

Contributing
============

Versioning
==========
----------

This library follows semantic versioning, and additions to the code ruleset
are only performed in major releases.

The patch branch can receive internal changes, such as CI pipeline
improvements, test workflow improvements, and can receive bugfixes. For
instance, such as removing rules that were not meant to be added.

The minor branch can receive refactorings, and dependency updates that
do not affect the code ruleset.

Testing
=======
-------

If you are contributing to the Doctrine Coding Standard and want to test your contribution, you just
need to execute the ``test`` GNU make target:
Expand All @@ -136,13 +146,21 @@ need to execute the ``test`` GNU make target:
Sometimes you are enabling a sniff that enforces some features for a specific PHP version, that will
probably cause our build pipeline to fail when running on such versions.

We have created the ``update-compatibility-patch`` GNU make target to help you with that:
We have created the ``update-compatibility-patch-*`` GNU make targets to
help you with that. For instance, for PHP 6.0, you would run

.. code-block:: bash
$ make update-compatibility-patch
$ make update-compatibility-patch-60
That target will attempt to apply the latest version of our
compatibility patch for that version of PHP and ask you to adjust the
code in ``tests/fixed`` and ``tests/expected_report.txt`` using the
editor of your preference.

If the patch does not apply cleanly, you can edit it to edit or remove
hunks that relate to files you changed in your PR.

That target will apply the latest version of our compatibility patch and ask you to adjust the code in ``tests/fixed`` and
``tests/expected_report.txt`` using the editor of your preference.
Once you are done, please type "y" to resume the command, which will update the compatibility patch and create a commit
with your changes for you to push to your remote branch.
Once you are done, please type "y" to resume the command, which will
update the compatibility patch and create a commit with your changes for
you to push to your remote branch.
4 changes: 2 additions & 2 deletions tests/expected_report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tests/input/class-references.php 10 0
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
tests/input/constants-var.php 7 0
tests/input/constants-var.php 6 0
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -52,7 +52,7 @@ tests/input/use-ordering.php 1 0
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
A TOTAL OF 452 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
----------------------------------------------------------------------
PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions tests/php72-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index 9e34caa..ea3b611 100644
index d1e1fad..ea3b611 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -16,26 +16,23 @@ tests/input/constants-var.php 7 0
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
tests/input/constants-var.php 6 0
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -51,8 +55,8 @@ index 9e34caa..ea3b611 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 452 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 405 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
-A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 404 ERRORS AND 0 WARNINGS WERE FOUND IN 44 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 327 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
Expand Down
12 changes: 8 additions & 4 deletions tests/php73-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index 9e34caa..c5062cb 100644
index d1e1fad..9a78bc1 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -16,26 +16,23 @@ tests/input/constants-var.php 7 0
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
tests/input/constants-var.php 6 0
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -52,8 +56,8 @@ index 9e34caa..c5062cb 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 452 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 407 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
-A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 406 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 329 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
Expand Down
12 changes: 8 additions & 4 deletions tests/php74-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index 9e34caa..ed67841 100644
index d1e1fad..ed67841 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -16,26 +16,23 @@ tests/input/constants-var.php 7 0
@@ -12,30 +12,27 @@ tests/input/class-references.php 10 0
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
tests/input/constants-var.php 6 0
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
Expand Down Expand Up @@ -50,8 +54,8 @@ index 9e34caa..ed67841 100644
-tests/input/UselessConditions.php 21 0
+tests/input/UselessConditions.php 20 0
----------------------------------------------------------------------
-A TOTAL OF 452 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 416 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
-A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 415 ERRORS AND 0 WARNINGS WERE FOUND IN 45 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 338 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
Expand Down
14 changes: 10 additions & 4 deletions tests/php80-compatibility.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
diff --git a/tests/expected_report.txt b/tests/expected_report.txt
index 9e34caa..71022c4 100644
index d1e1fad..71022c4 100644
--- a/tests/expected_report.txt
+++ b/tests/expected_report.txt
@@ -18,7 +18,6 @@ tests/input/doc-comment-spacing.php 11 0
@@ -12,13 +12,12 @@ tests/input/class-references.php 10 0
tests/input/ClassPropertySpacing.php 2 0
tests/input/concatenation_spacing.php 49 0
tests/input/constants-no-lsb.php 2 0
tests/input/constants-var.php 6 0
tests/input/ControlStructures.php 28 0
tests/input/doc-comment-spacing.php 11 0
tests/input/duplicate-assignment-variable.php 1 0
tests/input/EarlyReturn.php 7 0
tests/input/example-class.php 47 0
Expand All @@ -23,8 +29,8 @@ index 9e34caa..71022c4 100644
tests/input/useless-semicolon.php 2 0
tests/input/UselessConditions.php 21 0
----------------------------------------------------------------------
-A TOTAL OF 452 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 446 ERRORS AND 0 WARNINGS WERE FOUND IN 47 FILES
-A TOTAL OF 451 ERRORS AND 0 WARNINGS WERE FOUND IN 48 FILES
+A TOTAL OF 445 ERRORS AND 0 WARNINGS WERE FOUND IN 47 FILES
----------------------------------------------------------------------
-PHPCBF CAN FIX 374 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
+PHPCBF CAN FIX 368 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
Expand Down

0 comments on commit 8c3c932

Please # to comment.