-
-
Notifications
You must be signed in to change notification settings - Fork 244
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
APPLY_FIXES and for PHP_PHPCSFIXER linter #3963
Comments
@llaville any idea ? :) |
yes I've already a solution. |
Before forgetting, can you write what the fix consists about (in a sentence) |
of course, but as I am AFK (just on phone now), I'll give you an answer in 90 minutes. |
Here is my analysis of the situation : I think origin of issue is located there https://github.com/oxsecurity/megalinter/blob/v8.0.0/megalinter/Linter.py#L1258-L1267 In case of PHP_CS_FIXER linter it's the same executable (without Origin of this implementation came from PHPCS where there are two executables : one to check violation (phpcs) and another one to apply fixes (phpcbf) Hope my quick explains are enough. Sorry i'm a bit tired tonight ;-) |
I've a good new : I've prepared a fix for MegaLinter v8.0 and it seems that all run fines at least with PHP flavor (and PHP-CS-Fixer) I'll keep you aware. |
For MegaLinter Team members but also all users of PHP-CS-Linter, if you need help to configure this linter (for risky rules), please read this #3973 |
For MegaLinter Team, the PR 3974 is WIP because I've not apply all requires changes (CHANGELOG, build.sh contents) and more than that do more regression tests .... Next to come on 24/48 hours |
Thanks to CI that demonstrate the power of non-regression tests. Even if it's ok for PHP, it seems that my fix has introduced errors with others linters. I'll have a check on these later now ... no more free time |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
Since the fix is still lin progress I just add a comment to keep this issue open. |
@hirnschmalz The fix (PR #3974) is just waiting for review, but it seems that @nvuillam is a bit busy ! |
This issue has been automatically marked as stale because it has not had recent activity. If you think this issue should stay open, please remove the |
a comment to try to keep this issue alive 😉 |
@llaville my slowliness is caused to the fact that i feel that you update more than php stuff, like core behavior or Linter.py, and i'm scared of regressions ^^ Would you mind explain such updates ? 😊 |
@nvuillam Of course, I'll try to give another version of my previous explains PHP-CS-Fixer is a special case in MegaLinter PHP linters support ecosystem. There is only one exec to detect and fix rules issues (compare to PHPCS that require two executables: one to detect and one to fix) Arguments are declared into descriptor like that NB: the To fix violations, we have to remove at runtime the It's my vision to simplify usage of This is the reason why I've declared And code available in PR Linter.py that is compatible (for me) with all others linters. Other contents in this PR is just to show a complex example with PHP-CS-Fixer to fix risky rules (usage of Hope my explains are enough. Tell me if not, I'll try to give another version |
@llaville i think i get it :) But u still need to move the explanations in linter_text ^^ Are you available to do it now ? ( I pass the last PRs then try to generate a minor version today ^^ ) Otherwise tell me and I can do it for u :) |
@nvuillam Will try to do, but later this afternoon |
* fix for issue #3963 * regression with others linters than php_cs_fixer came from this chunk of code (removed) * extract code to enable or disable apply fixes feature * restore test file for risky rule in initial state * add note about PHP-PHPCSFIXER apply fixes * update CHANGELOG for #3963 --------- Co-authored-by: Nicolas Vuillamy <[email protected]>
Describe the bug
Violations found by PHP CS Fixer are not fixed.
To Reproduce
Steps to reproduce the behavior:
.mega-linter.yml
with the following contentnpx mega-linter-runner --release v8.0.0
(I also triednpx mega-linter-runner --release v8.0.0 --fix
)Expected behavior
PHP CS Fixer is called with
fix
(php php-cs-fixer.phar fix ...
) and fixes the violationsThe text was updated successfully, but these errors were encountered: