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 an exception for partial ident in the space-around-operator rule #940

Merged
merged 6 commits into from
Nov 8, 2016

Conversation

bgriffith
Copy link
Member

This PR fixes #929 which was giving a false positive when a hyphen was used in-between two interpolations. Since this hyphen - is a partial ident, an exception has been added to the rule.

$foo: #{$a}-#{$b};

<DCO 1.1 Signed-off-by: Ben Griffith gt11687@gmail.com>

@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.004%) to 97.559% when pulling 1fb6ca0 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 97.559% when pulling 1fb6ca0 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.004%) to 97.559% when pulling 7b42052 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

@bgriffith bgriffith added this to the 1.11.0 milestone Nov 7, 2016
* @returns {bool} true / false
*/
var isPartialIdent = function (operator, next, previous) {
return next.is('interpolation') && previous.is('interpolation');
Copy link
Member

Choose a reason for hiding this comment

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

Are we 100% sure that next and previous will be defined, we've seen a lot of errors of the type is of undefined before.

@@ -333,6 +333,8 @@ $qux: (2 +1)

$foo: scale-color($foo, $lightness: -14%)

$foobar: #{$foo}-#{$bar}
Copy link
Member

Choose a reason for hiding this comment

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

Not sure it's a working example but sassmeister parses this

$bar: 'test';

.test {
  content: #{$bar}-4;
}

should probably check this isn't a error either.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thinking about it, for a partial ident, the previous node only needs to be an interp. It doesn't matter about the next node.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's what I was thinking..

@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.007%) to 97.561% when pulling 5d87a11 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.007%) to 97.561% when pulling 68eec73 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.561% when pulling fc23cd8 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

1 similar comment
@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.007%) to 97.561% when pulling fc23cd8 on bgriffith:feature/add-ident-exception into 03e51bb on sasstools:develop.

@DanPurdy DanPurdy merged commit c7b3534 into sasstools:develop Nov 8, 2016
@DanPurdy DanPurdy deleted the feature/add-ident-exception branch November 8, 2016 10:53
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.

'Space expected around operator' picks up class name dash as operator
3 participants