-
Notifications
You must be signed in to change notification settings - Fork 319
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
JSHint fixes (including indentation & whitespace); #406
Conversation
Some of these fixes look like they are needed for consistency... however this is section blocked by #262 since I'm sure it deals with vote/flag/remove.... Placing on hold for the time being with a -1 until @sizzlemctwizzle can pipe in... there is still a lot of code normalizing to do, as well with strict mode too, but I've had to wait on that. |
@Martii commented on 6 nov. 2014 21:19 CET:
I understand your reasoning, where can I follow the current code of that issue? |
I can re-ask him in private if he doesn't mind being over trodden in that area but no promises. |
@Martii commented on 6 nov. 2014 21:33 CET:
Should have pinged him ( @sizzlemctwizzle ) myself, this private contacting is not a good way to work together and keep discussions public. |
He is in the public and so am I ... he just doesn't have a status update yet... sometimes everyone can use a reminder to go view a specific area... so non-issue there. |
I'm fairly opposed on these big formatting commits as they break code I'm too lazy to submit (not a good reason) and introduce bugs as there are no tests (not that I see any in this case). One rule I dislike about this commit has to be:
But now that I look at our styleguide, which I've totally read before, apparently the consistent Thanks for catching all the missing/extra I'll grumble and sigh when this is merged. Just be sure it's a quick clean cut. |
My personal opinion is to get this in as soon as possible; keep the base as consistent as possible and follow the styleguide as best possible, from the beginning. There we're no open PR's, so it looked the best time. |
I would like us to slowly actually follow And it's still "up in the air" about one liners although they should always have braces from my understanding of the STYLEGUIDE.md. JSHint isn't always correct either as proven multiple times in the past... but there are a few things that could be isolated from this PR, slowly, and merged in. |
@@ -23,50 +23,49 @@ exports.verify = function (aId, aStrategy, aUsername, aLoggedIn, aDone) { | |||
|
|||
findDeadorAlive(User, { 'auths': digest }, true, | |||
function (aAlive, aUser, aRemoved) { | |||
var pos = aUser ? aUser.auths.indexOf(digest) : -1; | |||
if (aRemoved) { aDone(null, false, 'user was removed'); } | |||
var pos = aUser ? aUser.auths.indexOf(digest) : -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the function body indented at the same level as the definition? Tabs vs Spaces issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it wants function
to be after the previous comma ,
.
It's all good. Make sure to fix whatever the merge conflict your other patches made. |
…into jshint Conflicts: controllers/issue.js
@Zren commented on 6 nov. 2014 23:26 CET:
Done. |
There's definitely some issues with JSHint here... I'm against this merge but I will wait a bit to see if sizzle is available... JSHint should NEVER change TODO comment lines as it moves where a change should be done and there is also some compliance with our STYLEGUIDE that JSHint doesn't pay attention to... should know more later. |
That's not an JSHint issue. Can revert that change. Please point to the corresponding lines. |
As I stated above this is on HOLD regardless of styling because it's section blocked... I will get back to it at a later point... otherwise if you are impatient I'll just close it as invalid. |
secret: sessionSecret, | ||
store: sessionStore | ||
})); | ||
secret: sessionSecret, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moot whitespace adjustment
.caseInsensitive(script.issuesCategorySlug), open: {$ne: false} }); | ||
var scriptOpenIssueCountQuery = Discussion.find({ | ||
category: scriptStorage | ||
.caseInsensitive(script.issuesCategorySlug), open: { $ne: false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Period can be considered to be an operator so this is incorrect.
@@ -0,0 +1 @@ | |||
**/ace/**.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not everyone uses JSHint... and I think Zren mentioned to you that this could be done in your .git
folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up #97
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#97 is currently stale (not to mention problematic) and you might notice I didn't include it in the #249 milestones. See #97 (comment).
If this were merged, which I'm -1 on it still, the inline comments become part of this PR historically... however if you want it here I'll echo it:
e.g. too many changes in this PR that are controversial at this point in time... there is the needed semi-colon fixes, |
So how do we proceed? because I feel a lot of resistance to this PR. |
...
...
In general I'm not thrilled with that auto-indent thing you are using and would suggest that you omit that. You can either submit a commit to restore all the whitespace/linebreaks back to where it was in this PR or close it and submit new ones... left it open for you to decide... although since you are making files I'm not quite sure how that would work for you removing the dot files... so probably best to do another PR unless you or GH have a trick up your sleeve. |
@@ -1496,7 +1500,8 @@ exports.flag = function (aReq, aRes, aNext) { | |||
var fn = flagLib[unflag && unflag === 'unflag' ? 'unflag' : 'flag']; | |||
if (aErr || !aUser) { return aNext(); } | |||
|
|||
fn(User, aUser, aReq.session.user, function (aFlagged) { // TODO: Non-descript function name | |||
fn(User, aUser, aReq.session.user, function (aFlagged) { | |||
// TODO: Non-descript function name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a prime example of why they shouldn't be moved... the TODO is actually meant for the statement before it.
@Martii commented on 8 nov. 2014 19:17 CET:
... @jerone commented on 8 nov. 2014 16:11 CET:
Closing this PR as I'm probably going to send separate PR's. |
@@ -44,7 +44,7 @@ function removeable(aModel, aContent, aUser, aCallback) { | |||
exports.removeable = removeable; | |||
|
|||
function remove(aModel, aContent, aUser, aReason, aCallback) { | |||
var remove = new Remove({ | |||
var removeModel = new Remove({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here we go again... newly renamed identifier.
@@ -136,7 +138,7 @@ var applyModelListQueryFlaggedFilter = function (aModelListQuery, aOptions, aFla | |||
if (aFlaggedQuery == 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw seems to have missed this one
This PR includes:
No functionality should have been changed!
Node modules & ace has been ignored.
Some files still have warnings, but those warnings needs addressing later as it might involve functionality changes:
controllers/_template.js
controllers/scriptStorage.js
controllers/user.js
libs/modelQuery.js
libs/modifySessions.js
libs/muExpress.js
libs/remove.js
libs/templateHelpers.js
Hoping that this can reviewed asap to keep conflicts as a minimum.