Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Add code style check on changed files only. #68

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

message-dimke
Copy link

@message-dimke message-dimke commented Oct 9, 2023

Changes proposed in this Pull Request:

Adding PHP multi-version code style check on PR files only.

Detailed test instructions:

There are two ways to test the PR.

Checkout test/phpcs-changed branch. Yes, it is not a typo #69.

  1. Checkout test/phpcs-changed. This is the branch made from add/phpcs-changed but with few updates to make some checks fail.
  2. Look into /src/phpcs_test folder for files with different code fragments supported by PHP8.2 but not PHP7.4 language versions.
  3. Also there is the update to the workflow file not to fail-fast when running PR checks. Because of it you will see tests for 8.2 pass and 7.4 fail with reasons.
  4. phpcs-changed is configured to look for changes in PR files against develop branch. Please note the command must look something like this:
vendor/bin/phpcs-changed --warning-severity=0 -s --git --git-base 0b1850098265bda5f2e38529b8651802804f21e8 src/phpcs_test/class-base.php src/phpcs_test/class-demo.php src/phpcs_test/misc.php

Note the list of files to check.

Also, please, not the --warning-severity=0 which will hide warnings.

Branch from add/phpcs-changed branch and use the instructions below.

  1. Branch from add/phpcs-changed.
  2. Update .github/workflows/php-cs-on-changes.yml with fail-fast: false property value.
    ...
    strategy:
      matrix:
        php: [7.4, 8.2]
      fail-fast: false
    ...
  1. Download files into /src and commit them to your branch. phpcs_test.zip
  2. Create a PR and see the checks.
  3. Add changes to the files as will to compatibility check cases you know.

Changelog entry

Dev - Add phpcs on changed files only.

@message-dimke message-dimke self-assigned this Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant