Skip to content

Commit

Permalink
Always use 'dart format' instead of 'flutter format'. (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Aug 17, 2023
1 parent ac35336 commit 258caa4
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.21.36

- Always use `dart format` instead of `flutter format`.

## 0.21.35

- Merge Dart 3 compatibility report into static analysis.
Expand Down
4 changes: 1 addition & 3 deletions lib/src/report/static_analysis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,7 @@ Future<List<Issue>> _formatPackage(
return unformattedFiles
.map((f) => Issue(
'$f doesn\'t match the Dart formatter.',
suggestion: usesFlutter
? 'To format your files run: `flutter format .`'
: 'To format your files run: `dart format .`',
suggestion: 'To format your files run: `dart format .`',
))
.toList();
} on ToolException catch (e) {
Expand Down
5 changes: 1 addition & 4 deletions lib/src/sdk_env.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ class ToolEnvironment {
params.add(fullPath);

final result = await runProc(
[
...usesFlutter ? _flutterSdk.flutterCmd : _dartSdk.dartCmd,
...params,
],
[..._dartSdk.dartCmd, ...params],
environment: environment,
timeout: _dartfmtTimeout,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pana
description: PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package.
version: 0.21.35
version: 0.21.36
repository: https://github.com/dart-lang/pana
topics:
- tool
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/audio_service-0.18.4.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"grantedPoints": 40,
"maxPoints": 50,
"status": "partial",
"summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 24 issues. Showing the first 2:\n\n<details>\n<summary>\nINFO: 'hashValues' is deprecated and shouldn't be used. Use Object.hash() instead. This feature was deprecated in v3.1.0-0.0.pre.897.\n</summary>\n\n`lib/audio_service.dart:301:23`\n\n```\n ╷\n301 │ int get hashCode => hashValues(\n │ ^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/audio_service.dart`\n</details>\n<details>\n<summary>\nINFO: 'hashList' is deprecated and shouldn't be used. Use Object.hashAll() or Object.hashAllUnordered() instead. This feature was deprecated in v3.1.0-0.0.pre.897.\n</summary>\n\n`lib/audio_service.dart:304:9`\n\n```\n ╷\n304 │ hashList(controls),\n │ ^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/audio_service.dart`\n</details>"
"summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 23 issues. Showing the first 2:\n\n<details>\n<summary>\nINFO: 'hashValues' is deprecated and shouldn't be used. Use Object.hash() instead. This feature was deprecated in v3.1.0-0.0.pre.897.\n</summary>\n\n`lib/audio_service.dart:301:23`\n\n```\n ╷\n301 │ int get hashCode => hashValues(\n │ ^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/audio_service.dart`\n</details>\n<details>\n<summary>\nINFO: 'hashList' is deprecated and shouldn't be used. Use Object.hashAll() or Object.hashAllUnordered() instead. This feature was deprecated in v3.1.0-0.0.pre.897.\n</summary>\n\n`lib/audio_service.dart:304:9`\n\n```\n ╷\n304 │ hashList(controls),\n │ ^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `flutter analyze lib/audio_service.dart`\n</details>"
},
{
"id": "dependency",
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/audio_service-0.18.4.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Because:

### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues

Found 24 issues. Showing the first 2:
Found 23 issues. Showing the first 2:

<details>
<summary>
Expand Down
6 changes: 3 additions & 3 deletions test/goldens/end2end/url_launcher-6.1.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@
{
"id": "analysis",
"title": "Pass static analysis",
"grantedPoints": 40,
"grantedPoints": 50,
"maxPoints": 50,
"status": "partial",
"summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\n* Running `dartfmt` failed."
"status": "passed",
"summary": "### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues\n"
},
{
"id": "dependency",
Expand Down
5 changes: 2 additions & 3 deletions test/goldens/end2end/url_launcher-6.1.2.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ Detected license: `BSD-3-Clause`.
* ✓ MacOS
* ✓ Web

## 40/50 Pass static analysis
## 50/50 Pass static analysis

### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues
### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues

* Running `dartfmt` failed.

## 20/20 Support up-to-date dependencies

Expand Down

0 comments on commit 258caa4

Please sign in to comment.