-
Notifications
You must be signed in to change notification settings - Fork 370
--fatal-deprecation excludes obsolete Deprecations #2671
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 0.4.35 | ||
|
|
||
| * No user-visible changes. | ||
|
|
||
| ## 0.4.34 | ||
|
|
||
| * No user-visible changes. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| ## 16.0.2 | ||
|
|
||
| * No user-visible changes. | ||
|
|
||
| ## 16.0.1 | ||
|
|
||
| * No user-visible changes. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ library; | |
| import 'package:test/test.dart'; | ||
|
|
||
| import 'package:sass/sass.dart'; | ||
| import 'package:pub_semver/pub_semver.dart'; | ||
|
|
||
| void main() { | ||
| // Deprecated in all version of Dart Sass | ||
|
|
@@ -151,6 +152,41 @@ void main() { | |
| ); | ||
| }); | ||
| }); | ||
|
|
||
| group('Deprecation.forVersion', () { | ||
| test('includes deprecations as of that version', () { | ||
| final version = Version.parse('1.79.0'); | ||
| final deprecations = Deprecation.forVersion(version); | ||
|
|
||
| expect( | ||
| deprecations, | ||
| contains(Deprecation.colorFunctions), | ||
| reason: 'color-functions deprecated in 1.79 (and not obsolete)', | ||
| ); | ||
| }); | ||
|
|
||
| test('excludes deprecations of newer versions', () { | ||
| final version = Version.parse('1.79.0'); | ||
| final deprecations = Deprecation.forVersion(version); | ||
|
|
||
| expect( | ||
| deprecations, | ||
| isNot(contains(Deprecation.import)), | ||
| reason: 'import deprecated as of 1.80', | ||
| ); | ||
| }); | ||
|
|
||
| test('excludes deprecations that are obsolete', () { | ||
| final version = Version.parse('1.79.0'); | ||
| final deprecations = Deprecation.forVersion(version); | ||
|
|
||
| expect( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just check that a couple of the currently obsolete deprecations are excluded here. We use deprecations.yaml in the language repo as a single-source of truth for the current list of deprecations and don't want to have to manually update the list anywhere else.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand. I added two regression tests now (so that I don't break the current functionality) and one test for the intended fix (excluding obsolete deprecations). |
||
| deprecations, | ||
| isNot(contains(Deprecation.mixedDecls)), | ||
| reason: 'mixed-decls deprecated in 1.77.7 but obsolete in 1.92.0', | ||
| ); | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| /// Confirms that [source] will error if [deprecation] is fatal. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure about this (whether this is the Dart API or the JS API or both and if they were affected or not).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah,
Deprecation.forVersionis only exposed in the Dart API. I've added a changelog entry for this to the main Dart Sass changelog