diff --git a/pkgs/term_glyph/CHANGELOG.md b/pkgs/term_glyph/CHANGELOG.md index b7359cfb7..bf8eb791c 100644 --- a/pkgs/term_glyph/CHANGELOG.md +++ b/pkgs/term_glyph/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.2.3-wip + ## 1.2.2 * Require Dart 3.1 diff --git a/pkgs/term_glyph/lib/src/generated/ascii_glyph_set.dart b/pkgs/term_glyph/lib/src/generated/ascii_glyph_set.dart index 7c97d7f29..08534a07a 100644 --- a/pkgs/term_glyph/lib/src/generated/ascii_glyph_set.dart +++ b/pkgs/term_glyph/lib/src/generated/ascii_glyph_set.dart @@ -4,6 +4,8 @@ // Don't modify this file by hand! It's generated by tool/generate.dart. +// ignore_for_file: lines_longer_than_80_chars + import 'glyph_set.dart'; /// A [GlyphSet] that includes only ASCII glyphs. diff --git a/pkgs/term_glyph/lib/src/generated/glyph_set.dart b/pkgs/term_glyph/lib/src/generated/glyph_set.dart index be1a668a1..c8cc4a9b4 100644 --- a/pkgs/term_glyph/lib/src/generated/glyph_set.dart +++ b/pkgs/term_glyph/lib/src/generated/glyph_set.dart @@ -4,6 +4,8 @@ // Don't modify this file by hand! It's generated by tool/generate.dart. +// ignore_for_file: lines_longer_than_80_chars + /// A class that provides access to every configurable glyph. /// /// This is provided as a class so that individual chunks of code can choose @@ -37,14 +39,14 @@ abstract class GlyphSet { /// A left-pointing arrow. /// - /// Note that the Unicode arrow glyphs may overlap with adjacent characters in - /// some terminal fonts, and should generally be surrounding by spaces. + /// Note that the Unicode arrow glyphs may overlap with adjacent characters in some + /// terminal fonts, and should generally be surrounding by spaces. String get leftArrow; /// A right-pointing arrow. /// - /// Note that the Unicode arrow glyphs may overlap with adjacent characters in - /// some terminal fonts, and should generally be surrounding by spaces. + /// Note that the Unicode arrow glyphs may overlap with adjacent characters in some + /// terminal fonts, and should generally be surrounding by spaces. String get rightArrow; /// An upwards-pointing arrow. @@ -128,16 +130,13 @@ abstract class GlyphSet { /// A bold horizontal box line with a vertical line going up from the middle. String get teeUpBold; - /// A bold horizontal box line with a vertical line going down from the - /// middle. + /// A bold horizontal box line with a vertical line going down from the middle. String get teeDownBold; - /// A bold vertical box line with a horizontal line going left from the - /// middle. + /// A bold vertical box line with a horizontal line going left from the middle. String get teeLeftBold; - /// A bold vertical box line with a horizontal line going right from the - /// middle. + /// A bold vertical box line with a horizontal line going right from the middle. String get teeRightBold; /// The top half of a bold vertical box line. @@ -173,20 +172,16 @@ abstract class GlyphSet { /// An intersection of double vertical and horizontal box lines. String get crossDouble; - /// A double horizontal box line with a vertical line going up from the - /// middle. + /// A double horizontal box line with a vertical line going up from the middle. String get teeUpDouble; - /// A double horizontal box line with a vertical line going down from the - /// middle. + /// A double horizontal box line with a vertical line going down from the middle. String get teeDownDouble; - /// A double vertical box line with a horizontal line going left from the - /// middle. + /// A double vertical box line with a horizontal line going left from the middle. String get teeLeftDouble; - /// A double vertical box line with a horizontal line going right from the - /// middle. + /// A double vertical box line with a horizontal line going right from the middle. String get teeRightDouble; /// A dashed horizontal line that can be used to draw a box. diff --git a/pkgs/term_glyph/lib/src/generated/top_level.dart b/pkgs/term_glyph/lib/src/generated/top_level.dart index 925903eef..848ef6dfb 100644 --- a/pkgs/term_glyph/lib/src/generated/top_level.dart +++ b/pkgs/term_glyph/lib/src/generated/top_level.dart @@ -4,6 +4,8 @@ // Don't modify this file by hand! It's generated by tool/generate.dart. +// ignore_for_file: lines_longer_than_80_chars + import '../../term_glyph.dart' as glyph; /// A bullet point. @@ -14,8 +16,8 @@ String get bullet => glyph.glyphs.bullet; /// A left-pointing arrow. /// -/// Note that the Unicode arrow glyphs may overlap with adjacent characters in -/// some terminal fonts, and should generally be surrounding by spaces. +/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some +/// terminal fonts, and should generally be surrounding by spaces. /// /// If [glyph.ascii] is `false`, this is "←". If it's `true`, this is /// "<" instead. @@ -23,8 +25,8 @@ String get leftArrow => glyph.glyphs.leftArrow; /// A right-pointing arrow. /// -/// Note that the Unicode arrow glyphs may overlap with adjacent characters in -/// some terminal fonts, and should generally be surrounding by spaces. +/// Note that the Unicode arrow glyphs may overlap with adjacent characters in some +/// terminal fonts, and should generally be surrounding by spaces. /// /// If [glyph.ascii] is `false`, this is "→". If it's `true`, this is /// ">" instead. @@ -282,22 +284,19 @@ String get crossDouble => glyph.glyphs.crossDouble; /// "+" instead. String get teeUpDouble => glyph.glyphs.teeUpDouble; -/// A double horizontal box line with a vertical line going down from the -/// middle. +/// A double horizontal box line with a vertical line going down from the middle. /// /// If [glyph.ascii] is `false`, this is "╦". If it's `true`, this is /// "+" instead. String get teeDownDouble => glyph.glyphs.teeDownDouble; -/// A double vertical box line with a horizontal line going left from the -/// middle. +/// A double vertical box line with a horizontal line going left from the middle. /// /// If [glyph.ascii] is `false`, this is "╣". If it's `true`, this is /// "+" instead. String get teeLeftDouble => glyph.glyphs.teeLeftDouble; -/// A double vertical box line with a horizontal line going right from the -/// middle. +/// A double vertical box line with a horizontal line going right from the middle. /// /// If [glyph.ascii] is `false`, this is "╠". If it's `true`, this is /// "+" instead. diff --git a/pkgs/term_glyph/lib/src/generated/unicode_glyph_set.dart b/pkgs/term_glyph/lib/src/generated/unicode_glyph_set.dart index 1ddd165d7..7264e6df1 100644 --- a/pkgs/term_glyph/lib/src/generated/unicode_glyph_set.dart +++ b/pkgs/term_glyph/lib/src/generated/unicode_glyph_set.dart @@ -4,6 +4,8 @@ // Don't modify this file by hand! It's generated by tool/generate.dart. +// ignore_for_file: lines_longer_than_80_chars + import 'glyph_set.dart'; /// A [GlyphSet] that includes only Unicode glyphs. diff --git a/pkgs/term_glyph/pubspec.yaml b/pkgs/term_glyph/pubspec.yaml index c429307b9..bac16f1b6 100644 --- a/pkgs/term_glyph/pubspec.yaml +++ b/pkgs/term_glyph/pubspec.yaml @@ -1,5 +1,5 @@ name: term_glyph -version: 1.2.2 +version: 1.2.3-wip description: Useful Unicode glyphs and ASCII substitutes. repository: https://github.com/dart-lang/tools/tree/main/pkgs/term_glyph @@ -9,5 +9,4 @@ environment: dev_dependencies: csv: ^6.0.0 dart_flutter_team_lints: ^3.0.0 - dart_style: ^2.0.0 test: ^1.16.6 diff --git a/pkgs/term_glyph/tool/generate.dart b/pkgs/term_glyph/tool/generate.dart index f5cdade9e..b96b7bdf4 100644 --- a/pkgs/term_glyph/tool/generate.dart +++ b/pkgs/term_glyph/tool/generate.dart @@ -13,29 +13,29 @@ void main() { // Remove comments and empty lines. data.removeWhere((row) => row.length < 3); - Directory('lib/src/generated').createSync(recursive: true); + Directory(_generatedDir).createSync(recursive: true); _writeGlyphSetInterface(data); _writeGlyphSet(data, ascii: false); _writeGlyphSet(data, ascii: true); _writeTopLevel(data); - final result = Process.runSync( - 'pub', ['run', 'dart_style:format', '-w', 'lib/src/generated']); + final result = Process.runSync(Platform.resolvedExecutable, [ + 'format', + _generatedDir, + ]); print(result.stderr); exit(result.exitCode); } +const _generatedDir = 'lib/src/generated'; + /// Writes `lib/src/generated/glyph_set.dart`. void _writeGlyphSetInterface(List> data) { final file = - File('lib/src/generated/glyph_set.dart').openSync(mode: FileMode.write); + File('$_generatedDir/glyph_set.dart').openSync(mode: FileMode.write); + file.writeStringSync(_header); file.writeStringSync(r''' - // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file - // for details. All rights reserved. Use of this source code is governed by a - // BSD-style license that can be found in the LICENSE file. - - // Don't modify this file by hand! It's generated by tool/generate.dart. /// A class that provides access to every configurable glyph. /// @@ -84,16 +84,13 @@ void _writeGlyphSetInterface(List> data) { /// the Unicode glyph set. void _writeGlyphSet(List> data, {required bool ascii}) { final file = - File('lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart') + File('$_generatedDir/${ascii ? "ascii" : "unicode"}_glyph_set.dart') .openSync(mode: FileMode.write); final className = '${ascii ? "Ascii" : "Unicode"}GlyphSet'; file.writeStringSync(''' - // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file - // for details. All rights reserved. Use of this source code is governed by a - // BSD-style license that can be found in the LICENSE file. + $_header - // Don't modify this file by hand! It's generated by tool/generate.dart. import 'glyph_set.dart'; @@ -122,14 +119,10 @@ void _writeGlyphSet(List> data, {required bool ascii}) { /// Writes `lib/src/generated/top_level.dart`. void _writeTopLevel(List> data) { final file = - File('lib/src/generated/top_level.dart').openSync(mode: FileMode.write); + File('$_generatedDir/top_level.dart').openSync(mode: FileMode.write); file.writeStringSync(''' - // Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file - // for details. All rights reserved. Use of this source code is governed by a - // BSD-style license that can be found in the LICENSE file. - - // Don't modify this file by hand! It's generated by tool/generate.dart. + $_header import '../../term_glyph.dart' as glyph; '''); @@ -151,3 +144,13 @@ void _writeTopLevel(List> data) { } String _quote(String input) => input.contains("'") ? '"$input"' : "'$input'"; + +const _header = ''' +// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Don't modify this file by hand! It's generated by tool/generate.dart. + +// ignore_for_file: lines_longer_than_80_chars +''';