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

Fix multiline comments #146

Merged
merged 3 commits into from
Mar 23, 2018
Merged

Conversation

iilei
Copy link
Contributor

@iilei iilei commented Mar 22, 2018

As mentioned in #139 here is my suggested change to fix handling of multiline comments.

The commonComment function determines by line count whether to chose Double-Slashes // or C-Style comments /* ... */

For better consistency I also updated other formats than common.js - An extra commit intended to increase comprehensibility.

A bit of context for the LineBreak Character can be found at the eslint repo

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @iilei to sign the Salesforce Contributor License Agreement.

lines
of
comments
`.slice(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open for suggestions. My intention was to make the difference between input / output most comprehensible.

@iilei iilei force-pushed the fix_multiline_comments branch from 854dcdc to ae2cfa3 Compare March 22, 2018 05:08
Registers the following handlebars helpers:

* _cstylecomment_ marks text as C-Style comment
* _commoncomment_ line count based: applies C-Style or single line: '//'
* _indent (size=2)_ indents lines with 2 spaces (default size)

Relates to salesforce-ux#139
@iilei iilei force-pushed the fix_multiline_comments branch from ae2cfa3 to 9646d9b Compare March 22, 2018 05:11
@aputinski
Copy link
Contributor

This looks really good! I was talking with @kaelig about how comments are handled and wanted to get your thoughts on removing // style comments all together in favor of /* */? Then we could remove the code that checks for new lines

@iilei
Copy link
Contributor Author

iilei commented Mar 22, 2018

Yes makes sense.

For making the changes easy to understand I would simply add an extra commit. If you prefer a single commit in the git history I can also squash the changes into a single commit.

@aputinski
Copy link
Contributor

Additional commits are fine with me

Drop `//` entirely in favour of `/* */` as discussed with @aputinski
See Pull Request salesforce-ux#146 for more context
@aputinski
Copy link
Contributor

Thanks for making those changes — this is feeling really good!

@aputinski aputinski merged commit 58da589 into salesforce-ux:master Mar 23, 2018
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.

2 participants