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

Add autofix to comment-whitespace-inside #3619

Merged
merged 2 commits into from
Sep 24, 2018

Conversation

boccob
Copy link
Contributor

@boccob boccob commented Aug 26, 2018

Which issue, if any, is this issue related to?

Closes #3609

Is there anything in the PR that needs further explanation?

e.g. "No, it's self explanatory."

example:

  • option: always

    code

    /** comment**/

    fixed

    /** comment **/
  • option: never

    code

    /** comment**/

    fixed

    /**comment**/

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

What about?

/*
 *Comments
 *Comments
 *Comments
 *
 */

@hudochenkov
Copy link
Member

@evilebottnawi your test case is covered by these:

{
code: "/*\ncomment*/",
fixed: "/*comment*/",
message: messages.rejectedOpening,
line: 1,
column: 3
},
{
code: "/*comment\n*/",
fixed: "/*comment*/",
message: messages.rejectedClosing,
line: 1,
column: 10
},

This rule doesn't check for spaces for "*" outside of opening/closing construction. /* *Comments */ — second * (before "Comment") isn't checked by this rule.

@alexander-akait
Copy link
Member

@hudochenkov i think better add this case to tests

@hudochenkov
Copy link
Member

What should exactly that test case test?

Your example has no violations with always, and 2 violations with never. We're trying to have only one violation per test case in our tests.

@alexander-akait
Copy link
Member

@hudochenkov

{
  code: "/*comment\n *comment\n *comment\n */",
  fixed: "/* comment\n * comment\n * comment\n */",
  message: messages.expectedOpening,
  line: 1,
  column: 3
},

@boccob
Copy link
Contributor Author

boccob commented Sep 5, 2018

@evilebottnawi but there is no violations in case with "/* comment\n *comment\n *comment\n */" and always. Does it mean that rule should be updated as well?

@hudochenkov
Copy link
Member

@boccob there is a violation in @evilebottnawi's test case for always.

@boccob
Copy link
Contributor Author

boccob commented Sep 6, 2018

@hudochenkov that's true but fixed value is a bit confusing

@boccob
Copy link
Contributor Author

boccob commented Sep 6, 2018

I added two more test cases

@jeddy3
Copy link
Member

jeddy3 commented Sep 6, 2018

@evilebottnawi Does this now address your feedback?

@boccob
Copy link
Contributor Author

boccob commented Sep 11, 2018

@evilebottnawi can you check this PR again please?

@ntwb
Copy link
Member

ntwb commented Sep 20, 2018

A second thumbs up we can get this merged...

@jeddy3 jeddy3 merged commit 852d0b0 into stylelint:master Sep 24, 2018
@jeddy3
Copy link
Member

jeddy3 commented Sep 24, 2018

  • Added: comment-whitespace-inside autofix (#3619).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add autofix to comment-whitespace-inside
5 participants