Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpcs tool install squizlabs version but PHPCSStandards is expected #809

Closed
2 of 5 tasks
eclipxe13 opened this issue Jan 11, 2024 · 2 comments
Closed
2 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@eclipxe13
Copy link

Describe the bug
When installing the tool phpcs, it install old tool from squizlabs instead of new tool from PHPCSStandards.
At the setup-php-action documentation page, it links phpcs to PHPCSStandards.

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems
Ubuntu 22.04.3 LTS

PHP versions
PHP 8.2 & PHP 8.3 (other versions are also affected)

To Reproduce

  phpcs:
    name: Code Style (phpcs)
    runs-on: "ubuntu-latest"
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.3'
          coverage: none
          tools: phpcs
        env:
          fail-fast: true
      - name: Display phpcs version
        run: phpcs --version

Expected behavior
To install
PHP_CodeSniffer version 3.8.0 (stable) by Squiz and PHPCSStandards

Are you willing to submit a PR?
I've had check the source code but it looks like the tool already pointing to the right tool (from PHPCSStandards), but the installed version is different. I can try to make a PR but does not know what code to patch.

Workaround
Install using phive or composer, like:

  phpcs:
    name: Code Style (phpcs)
    runs-on: "ubuntu-latest"
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.3'
          coverage: none
          tools: cs2pr, phive
        env:
          fail-fast: true
      - name: Install phpcs
        run: phive install phpcs --trust-gpg-keys 5E6DDE998AB73B8E
      - name: Code style (phpcs)
        run: tools/phpcs -q --report=checkstyle | cs2pr
@eclipxe13 eclipxe13 added the bug Something isn't working label Jan 11, 2024
@shivammathur
Copy link
Owner

It is updated in the develop branch, I will create a release this weekend

@shivammathur
Copy link
Owner

Released 2.29.0 with the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants