Skip to content
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

Add Scrutinizer config file #330

Merged
merged 1 commit into from
Apr 26, 2015
Merged

Add Scrutinizer config file #330

merged 1 commit into from
Apr 26, 2015

Conversation

GaryJones
Copy link
Member

https://scrutinizer-ci.com

Tested against a fork of this repo (resulting suggestions to be applied later on) so will work when this repo is hooked up too.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 25, 2015

Is there anything we can do about the 'else on same line as brace from previous if' ? It's not part of the official WPCS and having it on the next line make for easier to read code.

@GaryJones
Copy link
Member Author

Is there anything we can do about the 'else on same line as brace from previous if' ? It's not part of the official WPCS and having it on the next line make for easier to read code.

It should be } else { as it is part of the standard. Scrutinizer does have a check for it, so we should be matching the handbook (even if WPCS doesn't check for it), i.e. your

}
else {

are not correct.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 25, 2015

It should be } else { as it is part of the standard.

Just read through it again and no, it does not say that. All it says is that braces should be used (rightfully so), not whether the else should be on the same or the next line.

@shivapoudel
Copy link
Contributor

@jrfnl IMO having } else { look pretty good rather than your's

}
else {

@GaryJones
Copy link
Member Author

It does say that: "Braces shall be used for all blocks in the style shown here". All the examples on that page use it, and most, if not all instances in WP core use it. It may not explicitly say "Put the } on the same line as the else {, but it's a fairly standard to use the One True Brace Style (variant of K&R) in WP. PSR-2 is the same for control structures.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 26, 2015

@GaryJones Darn, did I really read over that bit ? Ok, never mind, the standard it is. Just weirdly inconsistent with the rest of the standard (less whitespace while most of the standard goes for more whitespace).

@shivapoudel I didn't say anything about looking 'pretty/good'. My point was about ease of readability.

@jrfnl
Copy link
Contributor

jrfnl commented Apr 26, 2015

@GaryJones oh and are you happy with the resulting scrutinizer behaviour the way it is now ? I.e. can I merge ?

@GaryJones
Copy link
Member Author

Merge as is please - we can pick up issues about code style or other config tweaks later on.

jrfnl added a commit that referenced this pull request Apr 26, 2015
@jrfnl jrfnl merged commit 353ac10 into develop Apr 26, 2015
@jrfnl jrfnl deleted the feature/scutinizer-config branch April 26, 2015 12:28
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.

3 participants