- Issue created by @tr
- Merge request !10651Issue #3495586 by tr: PHPCS error in contributed module caused by core recipe README.txt β (Open) created by tr
- π³πΏNew Zealand quietone
The PHPCS checks in core do not check
.txt
files. It runs on these extensions,<arg name="extensions" value="engine,inc,install,module,php,profile,test,theme,yml"/>
. Where the module ipcountry is using a custom phpcs.xml that is checking .txt files.I suggest that the custom phpcs.xml be modified to only check files in that module.
- πΊπΈUnited States tr Cascadia
Where the module ipcountry is using a custom phpcs.xml that is checking .txt files.
Ah, thank you for noticing that.
But still, why is recipe.README.txt being moved into my modules codebase on GitLabCI if I don't have any recipes in the module and I am not testing recipes?
I think it still makes sense to patch recipe.README.txt so that it complies with coding standards, even if core doesn't about checking .txt files.
- π³πΏNew Zealand quietone
I don't know why phpcs for the module is running phpcs on core files, that sounds like a question for the gitlab templates project.
Drupal does not have coding standards for .txt files, so there isn't currently anything to comply with. The standard that does exist about the end of a file is for PHP files. The closest issue I know about is the Coding Standards one for markdown, #2952616: Adopt CommonMark spec for Markdown files β .
- πΊπΈUnited States tr Cascadia
I don't know why phpcs for the module is running phpcs on core files, that sounds like a question for the gitlab templates project.
No, you misread.
FILE: ...builds/project/ip2country/web/modules/custom/ip2country/recipes/README.txt
is a file inside the ip2country project folder. Presumably it was copied there by the GitLabCI job, because it is not present in the module's codebase. - π¨π¦Canada Charlie ChX Negyesi πCanada
I believe there are two independent problems here:
1. Trivial core fix to delete the spurious newline
2. Figure it out whether the core composer.json or https://git.drupalcode.org/project/gitlab_templates/-/blob/main/scripts/... causes this
- πΊπΈUnited States tr Cascadia
Yes, two independent issues, as you said. The MR addresses #1, but I don't know where to start with #2 because what's happening behind the scenes during GitLabCI deployment doesn't show up in the logs/artifacts.
I can narrow it down a bit because @quietone noted that my phpcs.xml.dist enables phpcs checking of txt files, while the core default does not check txt files.
Upon further examination, I see this exact same phpcs error on
[modulename]/recipe/README.txt
in every project I own that does phpcs checks on txt files. If you don't enable phpcs checks on txt files, you will never notice thatrecipe.README.txt
file is getting copied into every project during GitLabCI testing.I had tagged this issue with "Recipe initiative" because I though someone involved with the recipe project might recognize why this file is being copied into a contrib module folder.