diff --git a/lib/src/deprecation.dart b/lib/src/deprecation.dart index e7c4e6a4e..3281e720d 100644 --- a/lib/src/deprecation.dart +++ b/lib/src/deprecation.dart @@ -181,6 +181,7 @@ enum Deprecation { isFuture = false; /// Constructs a future deprecation. + // ignore: unused_element const Deprecation.future(this.id, {this.description}) : _deprecatedIn = null, _obsoleteIn = null, diff --git a/lib/src/embedded/compilation_dispatcher.dart b/lib/src/embedded/compilation_dispatcher.dart index a8c84c8eb..9862a97c1 100644 --- a/lib/src/embedded/compilation_dispatcher.dart +++ b/lib/src/embedded/compilation_dispatcher.dart @@ -145,7 +145,7 @@ final class CompilationDispatcher { try { var importers = request.importers.map((importer) => - _decodeImporter(request, importer) ?? + _decodeImporter(importer) ?? (throw mandatoryError("Importer.importer"))); var globalFunctions = request.globalFunctions @@ -159,7 +159,7 @@ final class CompilationDispatcher { color: request.alertColor, logger: logger, importers: importers, - importer: _decodeImporter(request, input.importer) ?? + importer: _decodeImporter(input.importer) ?? (input.url.startsWith("file:") ? null : sass.Importer.noOp), functions: globalFunctions, syntax: syntaxToSyntax(input.syntax), @@ -234,7 +234,7 @@ final class CompilationDispatcher { } /// Converts [importer] into a [sass.Importer]. - sass.Importer? _decodeImporter(InboundMessage_CompileRequest request, + sass.Importer? _decodeImporter( InboundMessage_CompileRequest_Importer importer) { switch (importer.whichImporter()) { case InboundMessage_CompileRequest_Importer_Importer.path: @@ -249,13 +249,13 @@ final class CompilationDispatcher { _checkNoNonCanonicalScheme(importer); return FileImporter(this, importer.fileImporterId); - case InboundMessage_CompileRequest_Importer_Importer.notSet: - _checkNoNonCanonicalScheme(importer); - return null; - case InboundMessage_CompileRequest_Importer_Importer.nodePackageImporter: return npi.NodePackageImporter( importer.nodePackageImporter.entryPointDirectory); + + case InboundMessage_CompileRequest_Importer_Importer.notSet: + _checkNoNonCanonicalScheme(importer); + return null; } } diff --git a/lib/src/functions/color.dart b/lib/src/functions/color.dart index 7f0acd1fb..abbf9d00a 100644 --- a/lib/src/functions/color.dart +++ b/lib/src/functions/color.dart @@ -1610,7 +1610,7 @@ BuiltInCallable _channelFunction( warnForDeprecation( "${global ? '' : 'color.'}$name() is deprecated. Suggestion:\n" "\n" - 'color.channel(\$color, \"$name\", \$space: $space)\n' + 'color.channel(\$color, "$name", \$space: $space)\n' "\n" "More info: https://sass-lang.com/d/color-functions", Deprecation.colorFunctions); diff --git a/test/util/string_test.dart b/test/util/string_test.dart index db8607098..9aa6563de 100644 --- a/test/util/string_test.dart +++ b/test/util/string_test.dart @@ -77,7 +77,7 @@ void main() { group("at the very beginning that's", () { for (var (name, (char, escape)) in chars.pairs) { - test(name, () => expect(char.toCssIdentifier(), equals('$escape'))); + test(name, () => expect(char.toCssIdentifier(), equals(escape))); } }); diff --git a/tool/grind/bump_version.dart b/tool/grind/bump_version.dart index bf28fc66b..d5fcd6491 100644 --- a/tool/grind/bump_version.dart +++ b/tool/grind/bump_version.dart @@ -62,14 +62,14 @@ void _bumpVersion(bool patch, bool dev) { void addChangelogEntry(String dir, Version version) { var path = p.join(dir, "CHANGELOG.md"); var text = File(path).readAsStringSync(); - if (!dev && text.startsWith("## ${version}-dev\n")) { + if (!dev && text.startsWith("## $version-dev\n")) { File(path).writeAsStringSync( - text.replaceFirst("## ${version}-dev\n", "## ${version}\n")); - } else if (text.startsWith("## ${version}\n")) { + text.replaceFirst("## $version-dev\n", "## $version\n")); + } else if (text.startsWith("## $version\n")) { return; } else { File(path).writeAsStringSync( - "## ${version}\n\n* No user-visible changes.\n\n$text"); + "## $version\n\n* No user-visible changes.\n\n$text"); } }