Closed (fixed)
Project:
Coder
Version:
8.x-2.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2016 at 20:09 UTC
Updated:
11 Sep 2016 at 18:44 UTC
Jump to comment: Most recent
Comments
Comment #2
klausiI think there is no coding standard specified for this - could you link to a place at https://www.drupal.org/coding-standards or subpages that specifies this?
Comment #3
damienmckennaYou are correct, so I opened an issue in the Coding Standards issue queue: #2690599: [policy, no patch] Standardize indenting on chained method calls
Comment #4
alexpott#2690599: [policy, no patch] Standardize indenting on chained method calls has agreed on 2 spaces.
Comment #6
klausiI pushed a start for this, but we will need proper testing for ObjectOperatorIndentSniff.
Comment #7
pfrenssenThis now throws a false positive on this structure:
I get a false positive "Object operator not indented correctly; expected 8 spaces but found 6"
Comment #8
pfrenssenStarted on a PR: https://github.com/klausi/coder/pull/10
Comment #9
pfrenssenI am having some failures that seem to be due to a bug in PHP_CodeSniffer. @Klausi maybe you have already encountered this before? The
nested_parenthesisseems to be incorrect. I'll explain more in detail on the PR.edit: there is no bug in PHP_CodeSniffer, I'm stupid.
Comment #10
pfrenssenPR is ready, I have done the following:
->) is at the end of the line.Changing this also to a feature request, this is not a bug but rather an implementation of a newly defined coding standards.
Comment #11
klausiThanks, left a couple of comments on the PR.
It looks like your test case from above with $membership is missing?
Comment #12
klausididn't mean to change the category.
Comment #13
pfrenssenThanks for the lightning fast review!! I fixed the remarks.
Comment #14
pfrenssenThis is actually covered by this part in the test, my example was from Organic Groups, but I replaced it with some core code that exhibits the same problem, this is more recognizable for people unfamiliar with OG:
Comment #16
klausiMerged, thanks!
Comment #17
klausiTested it a bit on core, identified some false positives. Thinking about rewriting the whole sniff, work in progress at https://github.com/klausi/coder/pull/13
Comment #19
klausiRewrote the sniff and all fixes for Drupal core look good now.