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

5 participants
@boccob
Contributor

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**/
@evilebottnawi

What about?

/*
 *Comments
 *Comments
 *Comments
 *
 */
@hudochenkov

This comment has been minimized.

Member

hudochenkov commented Sep 4, 2018

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

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Sep 4, 2018

@hudochenkov i think better add this case to tests

@hudochenkov

This comment has been minimized.

Member

hudochenkov commented Sep 4, 2018

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.

@evilebottnawi

This comment has been minimized.

Member

evilebottnawi commented Sep 4, 2018

@hudochenkov

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Member

hudochenkov commented Sep 5, 2018

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

@boccob

This comment has been minimized.

Contributor

boccob commented Sep 6, 2018

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

@boccob

This comment has been minimized.

Contributor

boccob commented Sep 6, 2018

I added two more test cases

@jeddy3

This comment has been minimized.

Member

jeddy3 commented Sep 6, 2018

@evilebottnawi Does this now address your feedback?

@boccob

This comment has been minimized.

Contributor

boccob commented Sep 11, 2018

@evilebottnawi can you check this PR again please?

@ntwb

ntwb approved these changes Sep 20, 2018

@ntwb

This comment has been minimized.

Member

ntwb commented Sep 20, 2018

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

Unavailable

@jeddy3

jeddy3 approved these changes Sep 24, 2018

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

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.07%) to 96.282%
Details
@jeddy3

This comment has been minimized.

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