-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
New Linter : PHP-CS-Fixer #3550
Comments
#3515 doesn't appear like a PR for me |
@echoix Of course, because I'm not opened a PR yet. |
I'm sad but I must admit that the SARIF support to PHP-CS-Fixer won't be for tomorrow (next days and/or months). BTW, I should at least propose a new PHP linter (following official project in current version 3.56 or greater) |
I think it's a shame not to be able to use the autofix feature for PHP Linters. So, even if PHP-CS-Fixer new linter is ready, I'm still working to be able to use the First run that seems matched At least PHP-CS-Fixer do its job, and the fix was applied, but the
Finally, I've choosen to prepare a PR without autofix feature fix for this linter |
@nvuillam I need your help to finish this linter. see chunk of deployment/test workflow
Test automation failed, but runtime is correct for me. |
@llaville it seems that phpcs fixer does not accept to find non fixable errors
If the test files do not fit, you can create another test directory and redirect tests to it using descriptor property |
@nvuillam After trying your tip, and see that it won't fix anything (sorry to said that), I've spent my time to track down where it came from. And PHP-CS-Fixer in in same context After applying patch below
I've rebuild the PHP flavor image, and run test again, in official
And got expected results :
So I think we should think about a better fix than this quick one (even if it works fine) ! WDTY ? |
@bdovaz There is no more hurry now. I'll be slow to respond in next days because I'll have a slow internet connection ! |
I'm a little bit lost ^^ |
@nvuillam You can help, either :
Because PHP-CS-Fixer run ok except for unit tests ! |
@llaville I'm not proud to say ok, but... ok :D |
Will have to wait I return to my home with a better internet connection. I'm very limited now :( |
@llaville do you think it would be ok this week-end when I may release a new version ? ^^ |
@nvuillam no sorry, make your release without it ! |
no soucy , do it when you can :) |
@nvuillam I've finally a good new ! I've fixed my mobile internet connection, and I should be able to prepare a PR today |
Great news :) |
I'm on way to prepare a PR. Just testing PHP flavor rebuilt with current branch rebased with main |
Consider the PR 3598 as a preview ! |
At all ML team / PR reviewers 👍 With same code when I build the PHP flavor and run locally docker run -e TEST_CASE_RUN=true -e TEST_KEYWORDS="php_phpcsfixer" -e OUTPUT_FORMAT=text -e OUTPUT_DETAIL=detailed -e MEGALINTER_VOLUME_ROOT="." --rm -v "/var/run/docker.sock:/var/run/docker.sock:rw" -v .:/tmp/lint <IMAGE_DOCKER_ID> I got following results
|
* introduces new linter for PHP-CS-Fixer (see feature report #3550) * changes after running build.py * fix cspell dict for missing words related to #3550 * wrong filename used for testing new linter PHP_PHPCSFIXER (see #3550) * automation about php-cs-fixer * quick fix for PHP-CS-Fixer util unit tests * ugly quick fix for new PHP-CS-Fixer linter * docs and automation files * clean-up code * [MegaLinter] Apply linters fixes * Workaround for test case names * [MegaLinter] Apply linters fixes * Fix --------- Co-authored-by: llaville <llaville@users.noreply.github.com> Co-authored-by: nvuillam <nicolas.vuillamy@gmail.com> Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
FYI: at all ML team. Thanks @nvuillam for packaging and fixing unit tests ! I've just tested the new version 7.12.0 (Docker PHP Flavor:
All seems OK for me on SARIF reports and new PHP-CS-Fixer, by activated following configuration : SARIF_REPORTER: true
SARIF_REPORTER_LINTERS:
- PHP_PHPCS
- PHP_PHPSTAN
- PHP_PHPLINT |
Is your feature request related to a problem? Please describe.
It's not a problem, and we may consider it as an improvement to PHP linters
Describe the solution you'd like
Add first integration of the official https://github.com/PHP-CS-Fixer/PHP-CS-Fixer tool to automatically check/fix PHP Coding Standards issues
Describe alternatives you've considered
It's an alternative to PHP_CodeSniffer
Additional context
Actually, I've already worked on a SARIF support (and my converter
PhpCsFixerConverter
forbartlett/sarif-php-sdk
: https://github.com/llaville/sarif-php-sdk is ready)Pre-conditions :
Here is a preview of such integration to MegaLinter
The text was updated successfully, but these errors were encountered: