- Issue created by @cafuego
- 🇬🇧United Kingdom jonathan1055
Yes I have found this too
------------------------------------------------------------------------------------ 16 | WARNING | All constants defined by a module must be prefixed with the module's name, | | expected "DEVEL_'DEVEL_ERROR_HANDLER_BACKTRACE_KINT'" | | but found "'DEVEL_ERROR_HANDLER_BACKTRACE_KINT'" (Drupal.Semantics.ConstantName.ConstantStart) ------------------------------------------------------------------------------------
Looking at the commits since 8.3.18 the bug was most likely introduced in ✨ Add checking 'const' to Drupal.Semantics.ConstantName.ConstantStart Fixed
Raising this to 'major' because any project using 8.3.19 or 8.3.20 (such as new GitLab pipeline tests) will be incorrectly reporting failures.
- Assigned to jonathan1055
- 🇬🇧United Kingdom jonathan1055
There is already a github issue for this https://github.com/pfrenssen/coder/issues/204
- Issue was unassigned.
- Status changed to Needs review
12 months ago 12:17pm 4 July 2023 - 🇬🇧United Kingdom jonathan1055
I first added test coverage in
ConstantNameUnitTest
and a new filetests/Drupal/good/good.module
to demonstrate the problem. Then it was a simple fix to remove the quotes in the $constName - and the tests pass again.PR https://github.com/pfrenssen/coder/issues/204 is ready for review.
-
jonathan1055 →
authored e79554be on 8.3.x
fix(ConstantName): Fix constant name detection with define() calls (#...
-
jonathan1055 →
authored e79554be on 8.3.x
- Status changed to Fixed
12 months ago 9:42am 11 July 2023 - 🇬🇧United Kingdom somersoft
Thank you for working on this issue.
May I suggest that you continue creating a series of good.* files, like the new tests/Drupal/good/good.module, which should never genrate warnings nor errors for the rules that coder is checking. That way if there is something breaks, like this then the test will fail and flag that there is an issue.
It also provides examples of good code style for all.
I see that in https://github.com/jonathan1055/coder/tree/8.3.x/tests/Drupal/good there are some files.
- 🇦🇹Austria klausi 🇦🇹 Vienna
Yes, that is a great idea! I think we should use it anytime for fixing false positives and regressions like this in the future.
- 🇬🇧United Kingdom jonathan1055
I see that in https://github.com/jonathan1055/coder/tree/8.3.x/tests/Drupal/good there are some files.
My fork is a direct copy of Coder, so all of those files were already being used in Coder, apart from the new which I added for this fix. Many things are checked in but the ConstantName sniff only read .module and .install files and skips everything else, so it would not have found the problem if the constant had been added to good.php
I have not done a thorough search to see if the 'good' files contain examples of all types of things that are checked. That would be a very long task. But we should definitely ensure that any sniff which is worked on and altered has at least something in one of the good.* files which is being checked.
- 🇬🇧United Kingdom jonathan1055
Updating title, as this regression was fixed 8.3.20 was released, so is still a problem "out in the world" until 8.3.21 is released.
Automatically closed - issue fixed for 2 weeks with no activity.