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

Update specs for strict unary deprecation #1823

Merged
merged 2 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
| ^^^^^^^^^^
'