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 specs for deprecated function names #1932

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
377 changes: 377 additions & 0 deletions spec/directives/function/deprecated_name/unvendored.hrx
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this case is considered too exceptional, but is it worth adding tests for functions which are renamed to these newly reserved functions?

For example:

// foo.scss
@use "bar" as *;

a {
  color: round();
}

// bar.scss
@forward "baz" as r*;

// baz.scss
@function ound() { @return 0 }

Which today will compile without error, but in the future will fail (as it currently does for a similar setup with e.g. calc).

I had thought it was easier to rename identifiers for some reason -- i.e. without the use of @forward, but I can't think of any concrete way off the top of my head.

Original file line number Diff line number Diff line change
@@ -0,0 +1,377 @@
<===> options.yml
:ignore_for:
- libsass

<===>
================================================================================
<===> round/input.scss
@function round() {@return a}
b {c: round()}

<===> round/output.css
b {
c: a;
}

<===> round/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "round" is deprecated because it conflicts with the new
CSS round() syntax. Either rename it or use the math.round() function.

More info: https:/sass-lang.com/d/math-fn-name
Copy link
Member

Choose a reason for hiding this comment

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

Already commented on dart-sass, but this is missing a slash after https:

,
1 | @function round() {@return a}
| ^^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> mod/input.scss
@function mod() {@return a}
b {c: mod()}

<===> mod/output.css
b {
c: a;
}

<===> mod/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "mod" is deprecated because it conflicts with the new
CSS mod() syntax. Please rename it.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function mod() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> rem/input.scss
@function rem() {@return a}
b {c: rem()}

<===> rem/output.css
b {
c: a;
}

<===> rem/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "rem" is deprecated because it conflicts with the new
CSS rem() syntax. Please rename it.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function rem() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> sin/input.scss
@function sin() {@return a}
b {c: sin()}

<===> sin/output.css
b {
c: a;
}

<===> sin/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "sin" is deprecated because it conflicts with the new
CSS sin() syntax. Either rename it or use the math.sin() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function sin() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> cos/input.scss
@function cos() {@return a}
b {c: cos()}

<===> cos/output.css
b {
c: a;
}

<===> cos/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "cos" is deprecated because it conflicts with the new
CSS cos() syntax. Either rename it or use the math.cos() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function cos() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> tan/input.scss
@function tan() {@return a}
b {c: tan()}

<===> tan/output.css
b {
c: a;
}

<===> tan/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "tan" is deprecated because it conflicts with the new
CSS tan() syntax. Either rename it or use the math.tan() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function tan() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> asin/input.scss
@function asin() {@return a}
b {c: asin()}

<===> asin/output.css
b {
c: a;
}

<===> asin/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "asin" is deprecated because it conflicts with the new
CSS asin() syntax. Either rename it or use the math.asin() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function asin() {@return a}
| ^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> acos/input.scss
@function acos() {@return a}
b {c: acos()}

<===> acos/output.css
b {
c: a;
}

<===> acos/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "acos" is deprecated because it conflicts with the new
CSS acos() syntax. Either rename it or use the math.acos() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function acos() {@return a}
| ^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> atan/input.scss
@function atan() {@return a}
b {c: atan()}

<===> atan/output.css
b {
c: a;
}

<===> atan/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "atan" is deprecated because it conflicts with the new
CSS atan() syntax. Either rename it or use the math.atan() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function atan() {@return a}
| ^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> atan2/input.scss
@function atan2() {@return a}
b {c: atan2()}

<===> atan2/output.css
b {
c: a;
}

<===> atan2/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "atan2" is deprecated because it conflicts with the new
CSS atan2() syntax. Either rename it or use the math.atan2() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function atan2() {@return a}
| ^^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> pow/input.scss
@function pow() {@return a}
b {c: pow()}

<===> pow/output.css
b {
c: a;
}

<===> pow/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "pow" is deprecated because it conflicts with the new
CSS pow() syntax. Either rename it or use the math.pow() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function pow() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> sqrt/input.scss
@function sqrt() {@return a}
b {c: sqrt()}

<===> sqrt/output.css
b {
c: a;
}

<===> sqrt/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "sqrt" is deprecated because it conflicts with the new
CSS sqrt() syntax. Either rename it or use the math.sqrt() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function sqrt() {@return a}
| ^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> hypot/input.scss
@function hypot() {@return a}
b {c: hypot()}

<===> hypot/output.css
b {
c: a;
}

<===> hypot/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "hypot" is deprecated because it conflicts with the new
CSS hypot() syntax. Either rename it or use the math.hypot() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function hypot() {@return a}
| ^^^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> log/input.scss
@function log() {@return a}
b {c: log()}

<===> log/output.css
b {
c: a;
}

<===> log/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "log" is deprecated because it conflicts with the new
CSS log() syntax. Either rename it or use the math.log() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function log() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> exp/input.scss
@function exp() {@return a}
b {c: exp()}

<===> exp/output.css
b {
c: a;
}

<===> exp/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "exp" is deprecated because it conflicts with the new
CSS exp() syntax. Please rename it.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function exp() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> abs/input.scss
@function abs() {@return a}
b {c: abs()}

<===> abs/output.css
b {
c: a;
}

<===> abs/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "abs" is deprecated because it conflicts with the new
CSS abs() syntax. Either rename it or use the math.abs() function.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function abs() {@return a}
| ^^^^^^^^^^^^^^^
'

<===>
================================================================================
<===> sign/input.scss
@function sign() {@return a}
b {c: sign()}

<===> sign/output.css
b {
c: a;
}

<===> sign/warning
DEPRECATION WARNING on line 1, column 1 of input.scss:
Naming a Sass function "sign" is deprecated because it conflicts with the new
CSS sign() syntax. Please rename it.

More info: https:/sass-lang.com/d/math-fn-name
,
1 | @function sign() {@return a}
| ^^^^^^^^^^^^^^^^
'
Loading