Skip to content

implement new sniff to force spaces after = #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

implement new sniff to force spaces after = #123

wants to merge 1 commit into from

Conversation

Ocramius
Copy link
Member

I haven't yet found the rule that will help with that (since MultipleStatementAlignmentSniff doesn't work here)

This PR/issue comes from this #103 (comment)

This is a copy of #117 as per #117 (comment)

@Ocramius
Copy link
Member Author

Travis-CI really doesn't like this patch at all: I'll push it up as a branch of this repo.

@SenseException
Copy link
Member

"Some checks haven’t completed yet" :-/

@SenseException
Copy link
Member

If this is going to be the first custom code for the coding-standard, should it introduce the test environment like introduced in #63?

greg0ire
greg0ire previously approved these changes May 1, 2019
@vv12131415
Copy link
Contributor

If this is going to be the first custom code for the coding-standard, should it introduce the test environment like introduced in #63?

I can add if you want

@Ocramius
Copy link
Member Author

Ocramius commented May 1, 2019

Yes, we'd most likely need proper coverage for new code, highlighting how much we're covering (branch-related). The existing tests are for regression/integration, and don't give us this confidence.

carusogabriel
carusogabriel previously approved these changes May 2, 2019
deeky666
deeky666 previously approved these changes May 2, 2019
Copy link
Member

@malarzm malarzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about writing own sniffs but given numer of tokens being registered I'd expect more tests than one assignment.

@vv12131415
Copy link
Contributor

@malarzm yes, you are absolutely right! Thanks for mentioning this

@vv12131415 vv12131415 dismissed stale reviews from deeky666, carusogabriel, and greg0ire via 32f030c May 12, 2019 00:09
@vv12131415
Copy link
Contributor

@Ocramius ok, I've done all the things, but one thing that doesn't work as expected is #123 (comment)

Copy link
Member Author

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@doctrine/coding-standard-approvers can I get your approvals/rejections in, please? I think further chore work should be deferred, unless it is something huge that wasn't spotted.

malarzm
malarzm previously approved these changes May 14, 2019
Copy link
Member

@malarzm malarzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from missing newlines in some files it's 👍 from me

deeky666
deeky666 previously approved these changes May 14, 2019
jwage
jwage previously approved these changes May 14, 2019
Copy link
Member

@jwage jwage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 👍

@vv12131415
Copy link
Contributor

Apart from missing newlines in some files it's from me

🤦‍♂️ yes, I see, I can fix it, but it will dismiss all of the reviews (don't want bother everyone yet another time)

@deeky666
Copy link
Member

Apart from missing newlines in some files it's from me

man_facepalming yes, I see, I can fix it, but it will dismiss all of the reviews (don't want bother everyone yet another time)

that's the way it is, no worries :)

@Ocramius Ocramius closed this May 15, 2019
@Ocramius Ocramius reopened this May 15, 2019
SenseException
SenseException previously approved these changes May 15, 2019
@vv12131415
Copy link
Contributor

Can you retrigger Travis CI?

@carusogabriel carusogabriel requested a review from a team May 18, 2019 21:21
Copy link
Contributor

@carusogabriel carusogabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉

carusogabriel
carusogabriel previously approved these changes May 18, 2019
Copy link
Contributor

@carusogabriel carusogabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉🎉🎉

SenseException
SenseException previously approved these changes May 18, 2019
malarzm
malarzm previously approved these changes May 18, 2019
@vv12131415 vv12131415 dismissed stale reviews from malarzm, SenseException, and carusogabriel via a5cbd93 May 20, 2019 09:36
Copy link
Contributor

@carusogabriel carusogabriel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this sniff works with:

$this->foo[$bar] =& $baz['quox'];

?

@malarzm
Copy link
Member

malarzm commented May 22, 2019

=& looks like an operator to me, personally I prefer writing $this->foo[$bar] = &$baz['quox'];

@carusogabriel
Copy link
Contributor

My bad, I was confusing this with +=, *=, .= 🤦‍♂️

@vv12131415
Copy link
Contributor

vv12131415 commented May 24, 2019

@carusogabriel since there is #126 should I close this one? Or I need to make some changes here?

@carusogabriel
Copy link
Contributor

@vladyslavstartsev Let's hold on this one until we get slevomat/cs v6 released, as well PHPCS v3.5 :)

@vv12131415
Copy link
Contributor

@carusogabriel sure! 👍

@simPod
Copy link
Contributor

simPod commented Aug 20, 2019

@carusogabriel
Copy link
Contributor

@simPod Looks like an idea. I hoped that PHPCS v3.5 would bring a fix to #126, but it looks like that didn't happen.

Unfortunately, we can't require cdn77/coding-standard here as that depends on doctrine/coding-standard, and it will always conflict with the master version.

Fell free to open a PR copying and pasting the sniff you created here if you allow us to use it, while we don't have the sniff of #126 ready to use 👍

@grongor
Copy link

grongor commented Oct 7, 2019

Hi, I created the PR @carusogabriel requested, based on @simPod suggestion. Check it out here #134 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants