Skip to content

Commit

Permalink
Fix dart analyze and format on 3.7.0 (#2513)
Browse files Browse the repository at this point in the history
Co-authored-by: Natalie Weizenbaum <[email protected]>
  • Loading branch information
ntkme and nex3 authored Feb 13, 2025
1 parent f766f43 commit 7ab44ef
Show file tree
Hide file tree
Showing 271 changed files with 20,151 additions and 11,993 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart format --fix .
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- run: dart format .
- run: dart fix --apply
- run: git diff --exit-code

static_analysis:
Expand Down
29 changes: 20 additions & 9 deletions bin/sass.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,29 @@ Future<void> main(List<String> args) async {
options.futureDeprecations;
options.fatalDeprecations;

var graph = StylesheetGraph(ImportCache(
var graph = StylesheetGraph(
ImportCache(
importers: [...options.pkgImporters, FilesystemImporter.noLoadPath],
loadPaths: options.loadPaths));
loadPaths: options.loadPaths,
),
);
if (options.watch) {
await watch(options, graph);
return;
}

await compileStylesheets(options, graph, options.sourcesToDestinations,
ifModified: options.update);
await compileStylesheets(
options,
graph,
options.sourcesToDestinations,
ifModified: options.update,
);
} on UsageException catch (error) {
print("${error.message}\n");
print("Usage: sass <input.scss> [output.css]\n"
" sass <input.scss>:<output.css> <input/>:<output/> <dir/>\n");
print(
"Usage: sass <input.scss> [output.css]\n"
" sass <input.scss>:<output.css> <input/>:<output/> <dir/>\n",
);
print(ExecutableOptions.usage);
exitCode = 64;
} catch (error, stackTrace) {
Expand All @@ -75,7 +84,8 @@ Future<void> main(List<String> args) async {
buffer.writeln();
buffer.writeln();
buffer.write(
Trace.from(getTrace(error) ?? stackTrace).terse.toString().trimRight());
Trace.from(getTrace(error) ?? stackTrace).terse.toString().trimRight(),
);
printError(buffer);
exitCode = 255;
}
Expand All @@ -92,8 +102,9 @@ Future<String> _loadVersion() async {
return version;
}

var libDir =
p.fromUri(await Isolate.resolvePackageUri(Uri.parse('package:sass/')));
var libDir = p.fromUri(
await Isolate.resolvePackageUri(Uri.parse('package:sass/')),
);
var pubspec = readFile(p.join(libDir, '..', 'pubspec.yaml'));
return pubspec
.split("\n")
Expand Down
Loading

0 comments on commit 7ab44ef

Please sign in to comment.