Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Bug with indentation for multiline comments #1121

Closed
royerboat opened this issue Feb 27, 2015 · 5 comments
Closed

Bug with indentation for multiline comments #1121

royerboat opened this issue Feb 27, 2015 · 5 comments

Comments

@royerboat
Copy link

Getting a strange indentation error inside of a multi-line comment.

The following code that triggers the warning:

/*
# this is a line
# this is another line
*/
var hello = "World";

Actual warning result:

validateIndentation: Multiline comments should not have tokens on its ending line at jscs-bug.js :
     1 |/*
     2 |# this is a line
----------^
     3 |# this is another line
     4 |*/


1 code style error found.

The validate config I'm using:
"validateIndentation": 4

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@mikesherov
Copy link
Contributor

@royerboat this will be fixed in the next release. Thanks for contributing!

@royerboat
Copy link
Author

Glad to hear it! Thanks for responding so quickly!

@mikesherov mikesherov added this to the 1.12 milestone Feb 28, 2015
@mikesherov mikesherov self-assigned this Feb 28, 2015
mikesherov added a commit to mikesherov/node-jscs that referenced this issue Feb 28, 2015
Also includes update to tokenAssert to preserve indentation when
augmenting line count as this would otherwise throw off indentation.

Refs jscs-dev#516
Refs jscs-dev#1121
Closes jscs-dev#1073
Closes jscs-dev#1085
Closes jscs-devgh-1087
@mikesherov mikesherov modified the milestones: 1.later, 1.12 Feb 28, 2015
@mikesherov
Copy link
Contributor

This no longer triggers an error once 1.12 goes out, but we're still doing unsafe manipulations to the code when a # appears inside a multiline token like:

/*
#
*/

or

var a = "\
#\
";

cc @markelog or @zxqfox or @mdevils

@mrjoelkemp mrjoelkemp added the bug label Mar 11, 2015
@Reinmar
Copy link

Reinmar commented Mar 11, 2015

Another test case:

   345 |  );
Multiline comments should not have tokens on its ending line at core/loader.js :
   227 |/*
   228 |foo
   229 |*/ // %REMOVE_LINE%
----------^
   230 |

Passes on master, throws on v1.11.3.

@markelog markelog removed this from the 2.later milestone Dec 27, 2015
@markelog
Copy link
Member

At this point only major and CST related bugs will be fixed.

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

No branches or pull requests

5 participants