Skip to content

Commit

Permalink
Update specs for strict unary deprecation (#1823)
Browse files Browse the repository at this point in the history
Closes #1792
  • Loading branch information
nex3 authored Sep 15, 2022
1 parent 3f1333f commit eee4e76
Show file tree
Hide file tree
Showing 12 changed files with 1,610 additions and 3 deletions.
24 changes: 24 additions & 0 deletions spec/libsass-closed-issues/issue_1739/basic.hrx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<===> options.yml
:ignore_for:
- libsass

<===> input.scss
div {
baz: 2/3;
Expand Down Expand Up @@ -104,3 +108,23 @@ mod {
baz: 2;
baz: 2;
}

<===> warning
DEPRECATION WARNING on line 11, column 8 of input.scss:
This operation is parsed as:

2 + 3

but you may have intended it to mean:

2 (+3)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: 2 +3;
| ^^^^^
'
59 changes: 58 additions & 1 deletion spec/libsass-closed-issues/issue_1739/interpolate/both.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,66 @@ mod {
baz: #{1 % 2} % #{1 % 2};
}
<===> error
DEPRECATION WARNING on line 11, column 10 of input.scss:
This operation is parsed as:

1 + 2

but you may have intended it to mean:

1 (+2)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: #{1 +2} +#{1 +2};
| ^^^^^
'

DEPRECATION WARNING on line 11, column 21 of input.scss:
This operation is parsed as:

1 + 2

but you may have intended it to mean:

1 (+2)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: #{1 +2} +#{1 +2};
| ^^^^^
'

DEPRECATION WARNING on line 11, column 8 of input.scss:
This operation is parsed as:

#{1 + 2} + #{1 + 2}

but you may have intended it to mean:

#{1 + 2} (+#{1 + 2})

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: #{1 +2} +#{1 +2};
| ^^^^^^^^^^^^^^^^^^^
'

Error: Undefined operation "2 * 2".
,
23 | baz: #{1*2}*#{1*2};
23 | baz: #{1*2}*#{1*2};
| ^^^^^^^^^^^^^
'
input.scss 23:8 root stylesheet
Expand Down
40 changes: 39 additions & 1 deletion spec/libsass-closed-issues/issue_1739/interpolate/left.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,47 @@ mod {
baz: #{1 % 2} % 3;
}
<===> error
DEPRECATION WARNING on line 11, column 10 of input.scss:
This operation is parsed as:

1 + 2

but you may have intended it to mean:

1 (+2)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: #{1 +2} +3;
| ^^^^^
'

DEPRECATION WARNING on line 11, column 8 of input.scss:
This operation is parsed as:

#{1 + 2} + 3

but you may have intended it to mean:

#{1 + 2} (+3)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: #{1 +2} +3;
| ^^^^^^^^^^^^
'

Error: Undefined operation "2 * 3".
,
23 | baz: #{1*2}*3;
23 | baz: #{1*2}*3;
| ^^^^^^^^
'
input.scss 23:8 root stylesheet
Expand Down
40 changes: 39 additions & 1 deletion spec/libsass-closed-issues/issue_1739/interpolate/right.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,47 @@ mod {
baz: 3 % #{1 % 2};
}
<===> error
DEPRECATION WARNING on line 11, column 14 of input.scss:
This operation is parsed as:

1 + 2

but you may have intended it to mean:

1 (+2)

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: 3 +#{1 +2};
| ^^^^^
'

DEPRECATION WARNING on line 11, column 8 of input.scss:
This operation is parsed as:

3 + #{1 + 2}

but you may have intended it to mean:

3 (+#{1 + 2})

Add a space after + to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
11 | baz: 3 +#{1 +2};
| ^^^^^^^^^^^^
'

Error: Undefined operation "3 * 2".
,
23 | baz: 3*#{1*2};
23 | baz: 3*#{1*2};
| ^^^^^^^^
'
input.scss 23:8 root stylesheet
Expand Down
24 changes: 24 additions & 0 deletions spec/libsass-closed-issues/issue_893.hrx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<===> options.yml
:ignore_for:
- libsass

<===> input.scss
$gutter: 20px;

Expand All @@ -8,3 +12,23 @@ $gutter: 20px;
.row {
margin: -20px;
}

<===> warning
DEPRECATION WARNING on line 4, column 11 of input.scss:
This operation is parsed as:

0 - $gutter

but you may have intended it to mean:

0 (-$gutter)

Add a space after - to clarify that it's meant to be a binary operation, or wrap
it in parentheses to make it a unary operation. This will be an error in future
versions of Sass.

More info and automated migrator: https://sass-lang.com/d/strict-unary
,
4 | margin: 0 -$gutter;
| ^^^^^^^^^^
'
Loading

0 comments on commit eee4e76

Please sign in to comment.