Skip to content

Commit

Permalink
Fix dart analyze warnings (#2412)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Oct 25, 2024
1 parent 5c63839 commit 7129352
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions lib/src/deprecation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions lib/src/embedded/compilation_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
Expand Down Expand Up @@ -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:
Expand All @@ -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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/functions/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/util/string_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
});

Expand Down
8 changes: 4 additions & 4 deletions tool/grind/bump_version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}

Expand Down

0 comments on commit 7129352

Please sign in to comment.