-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Update code style, partially use new qunit interface, give test module a new name #2542
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
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cd04a4c
Tests: Partially use new qunit interface
markelog b83dfa7
Tests: Do not define two modules with the same name
markelog b5caff3
Build: Update jscs and lint files
markelog 447e2a8
Build: correct jscs paths
markelog 38f5822
Build: correct style tests files which could be automatically corrected
markelog f4c2202
Ajax: do not quote "throws" option - use dot notation instead
markelog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| { | ||
| "preset": "jquery", | ||
|
|
||
| // remove after https://github.com/jscs-dev/node-jscs/issues/1685 | ||
| // and https://github.com/jscs-dev/node-jscs/issues/1686 | ||
| "requireCapitalizedComments": null, | ||
|
|
||
| "excludeFiles": [ "external", "src/intro.js", "src/outro.js", | ||
| "test/node_smoke_tests/lib/ensure_iterability.js" ] | ||
| "test/node_smoke_tests/lib/ensure_iterability.js", "node_modules" ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can changes like this wait for *SpacesInsideParenthesizedExpression?
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.
The rule itself is not such a big thing, when (and again, thousands apologies i still didn't get around to that request) this rule will be landed, we would need to update our code style, meaning, we would need to argue and probably vote again, after that, we would need to update documentation on the site, after that, we would need to add it to the
jquerypreset and after that, we would need to wait on next the minor release of jscs.That might take some time, whereas we have our code-style in current form, on which we all agreed upon. Whereas, if we would decide on that, we could auto-format it in the same easy way i did in this pull.
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.
That's a good point. I don't think we need to wait for that in order to land this PR.
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.
I wasn't advocating blocking the PR, just backing out the changes pertaining to spaces in parenthesized expressions (which I believe would shrink it considerably, but I suppose would require a temporary
requireSpacesInsideParenthesesoverride).As for revoting/updating documentation/etc., a rule requiring such spaces doesn't appear in http://contribute.jquery.org/style-guide/js/#spacing or the old .jscs.json, and in fact was stealth-added (from the perspective of this codebase, not its contributors) by jscs-dev/node-jscs@0f78baf in response to jquery/contribute.jquery.org#104 (which was about requiring spaces in function calls). Since you committed it, I can just directly ask how you would have treated expression parentheses if JSCS were capable of differentiating them. But I will point out that I haven't encountered one argument in favor of requiring them that didn't hinge upon style guide automation, which falls apart as soon as that process becomes sufficiently sophisticated.
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.
Well, in that discussion Mike suggested to remove all exceptions, so we wouldn't create sophisticated logic for the parentheses rules in JSCS needed only for the one preset, that was somewhat the point of that proposal.
I would follow the style guide, no matter of it is, i.e.
jquerypreset should represent it.Personally, i would add more exceptions to that rule as i suggested in jquery/contribute.jquery.org#104 including the "expression parentheses"
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.
I'm less bothered by the extra spaces in expression parenthesis as I am by the extra space at the end of our methods (i.e.
} );), which I don't think would require changes to jscs if we were comfortable with things likemethod( arg1, { object: value }).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.
I have one - it's just simpler to remember that an opening paren containing something is always followed by a space. Simpler for us, simpler for contributors.
But as long as the tooling enforces the agreed convention, I'm fine whatever we end up with.
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.
I like those spaces for consistency reasons. If the majority doesn't want
them, I'm fine with this exception (although I prefer not to have too many
exceptions as @mikesherov suggested) but it'd be good to have it checked or
we'll have half of the code in one style & half in the other.
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.
For now, I'm okay with leaving it as-is. If we agree to change it, we'll do another PR.