Skip to content

JSHint fixes (including indentation & whitespace);#406

Closed
jerone wants to merge 3 commits into
OpenUserJS:masterfrom
jerone:jshint
Closed

JSHint fixes (including indentation & whitespace);#406
jerone wants to merge 3 commits into
OpenUserJS:masterfrom
jerone:jshint

Conversation

@jerone
Copy link
Copy Markdown
Contributor

@jerone jerone commented Nov 6, 2014

This PR includes:

  • JSHint warning fixes.
  • Style consistency (including indentation & whitespace).

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.

@jerone jerone added CODE Some other Code related issue and it should clearly describe what it is affecting in a comment. PR READY This is used to indicate that a pull request (PR) is ready for evaluation. labels Nov 6, 2014
@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

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.

@jerone
Copy link
Copy Markdown
Contributor Author

jerone commented Nov 6, 2014

@Martii commented on 6 nov. 2014 21:19 CET:

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.

I understand your reasoning, where can I follow the current code of that issue?

@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

where can I follow the current code of that issue?

#262

I can re-ask him in private if he doesn't mind being over trodden in that area but no promises.

@jerone
Copy link
Copy Markdown
Contributor Author

jerone commented Nov 6, 2014

@Martii commented on 6 nov. 2014 21:33 CET:

#262

I can re-ask him in private if he doesn't mind being over trodden in that area but no promises.

Should have pinged him ( @sizzlemctwizzle ) myself, this private contacting is not a good way to work together and keep discussions public.

@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

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.

@Zren
Copy link
Copy Markdown
Contributor

Zren commented Nov 6, 2014

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:

if () return; and if ()\n return; are fine and don't need to be wrapped in {}. The \n is optional but is good to have. My rules are: {} is not optional if the statement uses more than a single line. {} is not optional if there is an else statement attached.

But now that I look at our styleguide, which I've totally read before, apparently the consistent {} is a thing. :/

Thanks for catching all the missing/extra ; though.

I'll grumble and sigh when this is merged. Just be sure it's a quick clean cut.

@jerone
Copy link
Copy Markdown
Contributor Author

jerone commented Nov 6, 2014

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.

@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

I would like us to slowly actually follow ./controllers/_template.js a little bit more... I know there are situations where we can't but overall it is my understanding that file is the preferred controller format.

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.

Comment thread libs/passportVerify.js
Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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 ,.

@Zren
Copy link
Copy Markdown
Contributor

Zren commented Nov 6, 2014

There we're no open PR's, so it looked the best time.

It's all good. Make sure to fix whatever the merge conflict your other patches made.

@jerone
Copy link
Copy Markdown
Contributor Author

jerone commented Nov 6, 2014

@Zren commented on 6 nov. 2014 23:26 CET:

Make sure to fix whatever the merge conflict your other patches made.

Done.

@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

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.

@jerone
Copy link
Copy Markdown
Contributor Author

jerone commented Nov 6, 2014

JSHint should NEVER change TODO comment lines

That's not an JSHint issue. Can revert that change. Please point to the corresponding lines.

@Martii
Copy link
Copy Markdown
Member

Martii commented Nov 6, 2014

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.

Comment thread app.js
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

moot whitespace adjustment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CODE Some other Code related issue and it should clearly describe what it is affecting in a comment.

Development

Successfully merging this pull request may close these issues.

3 participants