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

CodeSniffer works on latest MacOS ? #3567

Closed
pirmax opened this issue Mar 24, 2022 · 1 comment
Closed

CodeSniffer works on latest MacOS ? #3567

pirmax opened this issue Mar 24, 2022 · 1 comment

Comments

@pirmax
Copy link

pirmax commented Mar 24, 2022

Hi,

I use MacOS Monterey 12.3 and I want using PHP CodeSniffer on my Laravel project on version 9.5.1.
The PHPCS version is 3.6.2 (stable).

When I type this command on my MacOS console, I get no errors/warnings.
vendor/bin/phpcs or /opt/homebrew/bin/phpcs
When I type this command on Docker (Laravel Sail), I get all the errors/warnings.

image

FYI: I installed CS from composer and homebrew.

Thanks to help me please.

Max.

@martinjoiner
Copy link

The fact it took 22 milliseconds to run and printed no dots to the screen when run on the host machine suggests it didn't analyse any files, hence no errors. Then when you ran it inside the docker container it worked.

In my opinion I'd always go for running CodeSniffer inside a project's Docker container because I have subtly different PHP versions and standards in each of my projects so I keep them ring-fenced by doing the static analysis inside each project's container. This practice also helps keep things neat for when you want to push the project through a CI/CD pipeline.

Also, why are you using CodeSniffer when Laravel Sail comes packaged with Pint? If I were you I'd be sticking to the Laravel way and be running the sail pint command to enforce code standards.

Suggesting this issue is a candidate to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants