Skip to content

Commit 1fcec62

Browse files
committed
⬆️ Upgrade dart_style
1 parent 6707596 commit 1fcec62

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

analysis_options.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
include: all_lint_rules.yaml
2+
3+
formatter:
4+
trailing_commas: preserve
5+
26
analyzer:
37
errors:
48
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
@@ -8,9 +12,13 @@ analyzer:
812
invalid_annotation_target: false
913

1014
exclude:
15+
- lib/*.g.dart
16+
- lib/*.freezed.dart
1117
- lib/generated_plugin_registrant.dart
12-
- lib/**.g.dart
13-
- lib/**.freezed.dart
18+
- lib/EnvBaseVisitor.dart
19+
- lib/EnvLexer.dart
20+
- lib/EnvParser.dart
21+
- lib/EnvVisitor.dart
1422
- lib/antlr/**.dart
1523

1624
linter:

example/env.g.dart

+1-4
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,7 @@ class Env {
309309
}
310310

311311
@override
312-
String toString({
313-
int padRight = 19,
314-
String separator = ' : ',
315-
}) {
312+
String toString({int padRight = 19, String separator = ' : '}) {
316313
final sb = StringBuffer();
317314
sb.write('INT'.padRight(padRight));
318315
sb.write(separator);

lib/env2dart.dart

+4-2
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,10 @@ void envgen({
318318
]),
319319
);
320320
final dartEmitter = DartEmitter(orderDirectives: true);
321-
var code = library.accept(dartEmitter).toString();
322-
code = DartFormatter(fixes: StyleFix.all).format(code);
321+
String code = library.accept(dartEmitter).toString();
322+
code = DartFormatter(
323+
languageVersion: DartFormatter.latestLanguageVersion,
324+
).format(code);
323325
output ??= './lib/${clazz.snakeCase}.dart';
324326
if (!output.endsWith('.dart')) {
325327
output = '$output.dart';

pubspec.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repository: https://github.com/fluttercandies/env2dart
55
issue_tracker: https://github.com/fluttercandies/env2dart/issues
66

77
environment:
8-
sdk: '>=2.15.0 <4.0.0'
8+
sdk: ^3.0.0
99

1010
executables:
1111
env2dart: env2dart
@@ -17,8 +17,8 @@ dependencies:
1717
built_value: ^8.4.4
1818
cbor: ^6.3.5
1919
code_builder: ^4.4.0
20-
collection: '>=1.17.0 <2.0.0'
21-
dart_style: ^2.3.0
20+
collection: ^1.17.0
21+
dart_style: ^3.0.0
2222
dolumns: ^2.0.0
2323
path: ^1.8.3
2424
recase: ^4.1.0

0 commit comments

Comments
 (0)