Closed (fixed)
Project:
Entity API
Version:
8.x-1.x-dev
Component:
Core integration
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jan 2023 at 06:56 UTC
Updated:
27 Aug 2026 at 15:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sahil.goyal commentedResolving the PHPCS Errors those needs to be. even though there are still some phpcs issue are shown but i don't think those need need to be update, as it seen alright i let them be there, if find some changes to be done please revert anytime.
Comment #3
tr commentedMost of those issues in the output that you posted are because you didn't run PHPCS on the HEAD of the branch, but rather on a packaged distribution of this module.
We don't actually need to see all your output - the current coding standards issues are shown in the test output found on the project page under the "Automated testing" tab.
It is far more useful, to me, to restrict your fixes to one type of coding standard problem in each patch.
Your patch doesn't apply because the format is wrong. Specifically the path is wrong for each of the chunks. Your patch has (for example)
diff --git a/modules/contrib/entity/README.txt b/modules/contrib/entity/README.txtas the first line, but this should bediff --git a/README.txt b/README.txtand likewise for every chunk in the patch.Changes like:
and
are wrong. If the class is missing documentation, you have to write the documentation.
Also, when you break up lines that are too long, you need to pay attention to the coding standards. The point is not just to make the lines shorter, but to make them easier to read. Breaking them at random places without adding in the expected indentation actually makes things worse. For example:
Should be:
Comment #4
ayush.khare commentedFixed #2.
Comment #6
sidharth_soman commented@ayush.khare's patch applied cleanly and resolved most of the errors. The only ones remaining are array indentation and doc comment formatting stuff along with some unused variables. If it's better to leave the indentation and formatting as it is for readability purposes, then I think this is good enough for RTBC. Waiting for a confirmation, @TR.
Comment #7
himanshu_jhaloya commentedComment #8
himanshu_jhaloya commentedImproved the code phpcs
Comment #9
himanshu_jhaloya commentedComment #10
nayana_mvr commentedVerified the patch #8 and tested it on Drupal version 10.1.x and Entity version 8.x-1.x. The patch applied cleanly but there are few more issues found.
Comment #11
nayana_mvr commentedComment #12
avpadernoThe issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.
Comment #13
ashutosh ahirwal commentedIssue summary updated please review.
Comment #14
tr commentedThe issue summary is quite wrong still. Read what I said in #3. All of that extended output needs to be removed because it's wrong and misleading, and the summary needs a link to the test output and a list of coding standards the patch is intended to fix.
While there are some changes in the patch that are ready to commit, most of the patch is still not ready for the reasons I spelled out in #3. And specifically, because all these unrelated issues are lumped together into one big patch, it can't be committed until all the things are fixed.
Coding standards can point out things that need to be improved, like missing documentation comments. But the proper fix is NEVER to just put an empty or placeholder comment in there to make the errors go away. If the documentation comment is missing, then write the documentation. If the class is missing a class documentation comment, don't just put in the class name - that doesn't give us any information we don't already know, does not help anyone trying to understand the code, etc. It just makes the error disappear, which ensures that no one will every go back and fix it. If you're going to add documentation comments, do it right or not at all.
There are also new problems in the latest patch #8 which weren't in the original patch I commented on. Things like:
which is just plain wrong. That original line does not need to be changed at all, and the "fix" makes the code worse.
Comment #15
rohit.rawat619 commentedComment #16
rohit.rawat619 commentedComment #17
tr commentedPlease read what I wrote in #14.
Comment #18
capysara commentedComment #19
capysara commentedComment #20
capysara commentedComment #22
capysara commentedAdded MR for minor formatting updates.
Hiding patches to avoid confusion.
Comment #23
a.aaronjake commentedHi @everyone,
Applied the changes committed on MR!29, some files failed to apply, might be the reason the errors below were reported. Please see:
Kindly check
Thanks,
Jake
Comment #24
avpadernoNotice that this issue is titled Update formatting for phpcs coding standards. It is not supposed to fix all the PHP_CodeSniffer errors/warnings.
The merge request is 7 commits behind and 3 commits ahead of the upstream repository, but there are conflicts with the upstream repository. It is better to start from scratch with another merge request.
Comment #25
avpadernoComment #26
avpadernoComment #28
avpadernoComment #30
capysara commentedRerolled against latest version.
Comment #33
klausiThank you! I reverted some changes that are not needed to README.txt and "?" nullable operators.
PHPCS is green and this should be ready to merge.
Comment #35
klausiGot commit access thanks to @Berdir.
Merged, thanks everyone!