- Issue created by @jonathan1055
- 🇬🇧United Kingdom jonathan1055
Here's my first attempt at this. It finds all 'http' which do not have '(' immediatelt preceding it. So it currently fails because there are valid places in the doc pages where we have this. I am not sure how to cater for those yet.
Currently using a script but could convert to php.
- Status changed to Needs review
4 months ago 4:45pm 24 August 2024 - 🇬🇧United Kingdom jonathan1055
The 'check code' job now fails as required, with the return code detected. But the problem is what to do with the valid http text which does not need to be formatted. Maybe we can have an inline hideen comment to indicate that these can be ignored, similar to
cspell:ignore
orphpcs:ignore
Another thing iI noticed if the that grep
-r
displays the filename locally, but this does not do the same in the pipeline, and the filename is not shown. See attached. - 🇬🇧United Kingdom jonathan1055
I re-wrote the script in PHP to cater for the code blocks which will validly have plain http links.
Test showing just two non-formatted links (one in the PHPStan page that was missed and is not clickable, and the other I reverted from your fix)
https://git.drupalcode.org/issue/gitlab_templates-3469949/-/jobs/2545749Here is the passing job. PHPStan link formatted, and the tags link deleted (as it was already linked further up that page)
https://git.drupalcode.org/issue/gitlab_templates-3469949/-/jobs/2545879Ready for review.
- First commit to issue fork.
- Status changed to RTBC
4 months ago 10:08am 26 August 2024 - 🇪🇸Spain fjgarlin
The script looks good and the output is very clear too. Thanks for this.
RTBC.Do you need to revert the text that seems to be removed in the MR or is it really not needed?
I'll let you either fix it or comment here with whatever is next. The script looks good and we can start using it as it is an internal tool. - 🇬🇧United Kingdom jonathan1055
The text I removed is not needed, as the link was already in that same page further up. (see second part of the comment in #5)
Have you tried running < code?./scripts/run-local-checks.sh with this chnage? It works for me, but would be good to make sure it works for you too.
The log output just lists the unformatted links. Does it also need to say a one-liner about how to fix the listed problems. Someone other than you or me might be using it.
- Status changed to Needs work
4 months ago 1:04pm 26 August 2024 - 🇪🇸Spain fjgarlin
Yeah, I ran the script and it ran well. I also tried forcing an error and it found it.
Good point about the feedback on how to fix them. Happy for you to do that commit and it can go straight back to RTBC.
- Status changed to RTBC
4 months ago 1:13pm 26 August 2024 - 🇬🇧United Kingdom jonathan1055
Pushed one line change.
https://git.drupalcode.org/project/gitlab_templates/-/merge_requests/251...The text is only written if there are any faults found. Example attached.
-
fjgarlin →
committed b677210c on main authored by
jonathan1055 →
Issue #3469949 by jonathan1055, fjgarlin: Internal code check - find non...
-
fjgarlin →
committed b677210c on main authored by
jonathan1055 →
- Status changed to Fixed
4 months ago 8:30am 27 August 2024 Automatically closed - issue fixed for 2 weeks with no activity.