Skip to content

Commit b412ba4

Browse files
authored
[term_glyph] Drop dart_style dep (#1956)
1 parent f65dde0 commit b412ba4

File tree

7 files changed

+52
-50
lines changed

7 files changed

+52
-50
lines changed

pkgs/term_glyph/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.2.3-wip
2+
13
## 1.2.2
24

35
* Require Dart 3.1

pkgs/term_glyph/lib/src/generated/ascii_glyph_set.dart

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Don't modify this file by hand! It's generated by tool/generate.dart.
66

7+
// ignore_for_file: lines_longer_than_80_chars
8+
79
import 'glyph_set.dart';
810

911
/// A [GlyphSet] that includes only ASCII glyphs.

pkgs/term_glyph/lib/src/generated/glyph_set.dart

+13-18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Don't modify this file by hand! It's generated by tool/generate.dart.
66

7+
// ignore_for_file: lines_longer_than_80_chars
8+
79
/// A class that provides access to every configurable glyph.
810
///
911
/// This is provided as a class so that individual chunks of code can choose
@@ -37,14 +39,14 @@ abstract class GlyphSet {
3739

3840
/// A left-pointing arrow.
3941
///
40-
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in
41-
/// some terminal fonts, and should generally be surrounding by spaces.
42+
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some
43+
/// terminal fonts, and should generally be surrounding by spaces.
4244
String get leftArrow;
4345

4446
/// A right-pointing arrow.
4547
///
46-
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in
47-
/// some terminal fonts, and should generally be surrounding by spaces.
48+
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some
49+
/// terminal fonts, and should generally be surrounding by spaces.
4850
String get rightArrow;
4951

5052
/// An upwards-pointing arrow.
@@ -128,16 +130,13 @@ abstract class GlyphSet {
128130
/// A bold horizontal box line with a vertical line going up from the middle.
129131
String get teeUpBold;
130132

131-
/// A bold horizontal box line with a vertical line going down from the
132-
/// middle.
133+
/// A bold horizontal box line with a vertical line going down from the middle.
133134
String get teeDownBold;
134135

135-
/// A bold vertical box line with a horizontal line going left from the
136-
/// middle.
136+
/// A bold vertical box line with a horizontal line going left from the middle.
137137
String get teeLeftBold;
138138

139-
/// A bold vertical box line with a horizontal line going right from the
140-
/// middle.
139+
/// A bold vertical box line with a horizontal line going right from the middle.
141140
String get teeRightBold;
142141

143142
/// The top half of a bold vertical box line.
@@ -173,20 +172,16 @@ abstract class GlyphSet {
173172
/// An intersection of double vertical and horizontal box lines.
174173
String get crossDouble;
175174

176-
/// A double horizontal box line with a vertical line going up from the
177-
/// middle.
175+
/// A double horizontal box line with a vertical line going up from the middle.
178176
String get teeUpDouble;
179177

180-
/// A double horizontal box line with a vertical line going down from the
181-
/// middle.
178+
/// A double horizontal box line with a vertical line going down from the middle.
182179
String get teeDownDouble;
183180

184-
/// A double vertical box line with a horizontal line going left from the
185-
/// middle.
181+
/// A double vertical box line with a horizontal line going left from the middle.
186182
String get teeLeftDouble;
187183

188-
/// A double vertical box line with a horizontal line going right from the
189-
/// middle.
184+
/// A double vertical box line with a horizontal line going right from the middle.
190185
String get teeRightDouble;
191186

192187
/// A dashed horizontal line that can be used to draw a box.

pkgs/term_glyph/lib/src/generated/top_level.dart

+9-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Don't modify this file by hand! It's generated by tool/generate.dart.
66

7+
// ignore_for_file: lines_longer_than_80_chars
8+
79
import '../../term_glyph.dart' as glyph;
810

911
/// A bullet point.
@@ -14,17 +16,17 @@ String get bullet => glyph.glyphs.bullet;
1416

1517
/// A left-pointing arrow.
1618
///
17-
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in
18-
/// some terminal fonts, and should generally be surrounding by spaces.
19+
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some
20+
/// terminal fonts, and should generally be surrounding by spaces.
1921
///
2022
/// If [glyph.ascii] is `false`, this is "←". If it's `true`, this is
2123
/// "<" instead.
2224
String get leftArrow => glyph.glyphs.leftArrow;
2325

2426
/// A right-pointing arrow.
2527
///
26-
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in
27-
/// some terminal fonts, and should generally be surrounding by spaces.
28+
/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some
29+
/// terminal fonts, and should generally be surrounding by spaces.
2830
///
2931
/// If [glyph.ascii] is `false`, this is "→". If it's `true`, this is
3032
/// ">" instead.
@@ -282,22 +284,19 @@ String get crossDouble => glyph.glyphs.crossDouble;
282284
/// "+" instead.
283285
String get teeUpDouble => glyph.glyphs.teeUpDouble;
284286

285-
/// A double horizontal box line with a vertical line going down from the
286-
/// middle.
287+
/// A double horizontal box line with a vertical line going down from the middle.
287288
///
288289
/// If [glyph.ascii] is `false`, this is "╦". If it's `true`, this is
289290
/// "+" instead.
290291
String get teeDownDouble => glyph.glyphs.teeDownDouble;
291292

292-
/// A double vertical box line with a horizontal line going left from the
293-
/// middle.
293+
/// A double vertical box line with a horizontal line going left from the middle.
294294
///
295295
/// If [glyph.ascii] is `false`, this is "╣". If it's `true`, this is
296296
/// "+" instead.
297297
String get teeLeftDouble => glyph.glyphs.teeLeftDouble;
298298

299-
/// A double vertical box line with a horizontal line going right from the
300-
/// middle.
299+
/// A double vertical box line with a horizontal line going right from the middle.
301300
///
302301
/// If [glyph.ascii] is `false`, this is "╠". If it's `true`, this is
303302
/// "+" instead.

pkgs/term_glyph/lib/src/generated/unicode_glyph_set.dart

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
// Don't modify this file by hand! It's generated by tool/generate.dart.
66

7+
// ignore_for_file: lines_longer_than_80_chars
8+
79
import 'glyph_set.dart';
810

911
/// A [GlyphSet] that includes only Unicode glyphs.

pkgs/term_glyph/pubspec.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: term_glyph
2-
version: 1.2.2
2+
version: 1.2.3-wip
33
description: Useful Unicode glyphs and ASCII substitutes.
44
repository: https://github.com/dart-lang/tools/tree/main/pkgs/term_glyph
55

@@ -9,5 +9,4 @@ environment:
99
dev_dependencies:
1010
csv: ^6.0.0
1111
dart_flutter_team_lints: ^3.0.0
12-
dart_style: ^2.0.0
1312
test: ^1.16.6

pkgs/term_glyph/tool/generate.dart

+23-20
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,29 @@ void main() {
1313
// Remove comments and empty lines.
1414
data.removeWhere((row) => row.length < 3);
1515

16-
Directory('lib/src/generated').createSync(recursive: true);
16+
Directory(_generatedDir).createSync(recursive: true);
1717

1818
_writeGlyphSetInterface(data);
1919
_writeGlyphSet(data, ascii: false);
2020
_writeGlyphSet(data, ascii: true);
2121
_writeTopLevel(data);
2222

23-
final result = Process.runSync(
24-
'pub', ['run', 'dart_style:format', '-w', 'lib/src/generated']);
23+
final result = Process.runSync(Platform.resolvedExecutable, [
24+
'format',
25+
_generatedDir,
26+
]);
2527
print(result.stderr);
2628
exit(result.exitCode);
2729
}
2830

31+
const _generatedDir = 'lib/src/generated';
32+
2933
/// Writes `lib/src/generated/glyph_set.dart`.
3034
void _writeGlyphSetInterface(List<List<dynamic>> data) {
3135
final file =
32-
File('lib/src/generated/glyph_set.dart').openSync(mode: FileMode.write);
36+
File('$_generatedDir/glyph_set.dart').openSync(mode: FileMode.write);
37+
file.writeStringSync(_header);
3338
file.writeStringSync(r'''
34-
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
35-
// for details. All rights reserved. Use of this source code is governed by a
36-
// BSD-style license that can be found in the LICENSE file.
37-
38-
// Don't modify this file by hand! It's generated by tool/generate.dart.
3939
4040
/// A class that provides access to every configurable glyph.
4141
///
@@ -84,16 +84,13 @@ void _writeGlyphSetInterface(List<List<dynamic>> data) {
8484
/// the Unicode glyph set.
8585
void _writeGlyphSet(List<List<dynamic>> data, {required bool ascii}) {
8686
final file =
87-
File('lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart')
87+
File('$_generatedDir/${ascii ? "ascii" : "unicode"}_glyph_set.dart')
8888
.openSync(mode: FileMode.write);
8989

9090
final className = '${ascii ? "Ascii" : "Unicode"}GlyphSet';
9191
file.writeStringSync('''
92-
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
93-
// for details. All rights reserved. Use of this source code is governed by a
94-
// BSD-style license that can be found in the LICENSE file.
92+
$_header
9593
96-
// Don't modify this file by hand! It's generated by tool/generate.dart.
9794
9895
import 'glyph_set.dart';
9996
@@ -122,14 +119,10 @@ void _writeGlyphSet(List<List<dynamic>> data, {required bool ascii}) {
122119
/// Writes `lib/src/generated/top_level.dart`.
123120
void _writeTopLevel(List<List<dynamic>> data) {
124121
final file =
125-
File('lib/src/generated/top_level.dart').openSync(mode: FileMode.write);
122+
File('$_generatedDir/top_level.dart').openSync(mode: FileMode.write);
126123

127124
file.writeStringSync('''
128-
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
129-
// for details. All rights reserved. Use of this source code is governed by a
130-
// BSD-style license that can be found in the LICENSE file.
131-
132-
// Don't modify this file by hand! It's generated by tool/generate.dart.
125+
$_header
133126
134127
import '../../term_glyph.dart' as glyph;
135128
''');
@@ -151,3 +144,13 @@ void _writeTopLevel(List<List<dynamic>> data) {
151144
}
152145

153146
String _quote(String input) => input.contains("'") ? '"$input"' : "'$input'";
147+
148+
const _header = '''
149+
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
150+
// for details. All rights reserved. Use of this source code is governed by a
151+
// BSD-style license that can be found in the LICENSE file.
152+
153+
// Don't modify this file by hand! It's generated by tool/generate.dart.
154+
155+
// ignore_for_file: lines_longer_than_80_chars
156+
''';

0 commit comments

Comments
 (0)