Enforce and fix package:pedantic lints (#9)
- annotate_overrides
- prefer_single_quotes
Update `tool/generate.dart` to prefer single quotes and add override
annotations. Regenerate files. Fix other cases by hand.
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..108d105
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1 @@
+include: package:pedantic/analysis_options.yaml
diff --git a/lib/src/generated/ascii_glyph_set.dart b/lib/src/generated/ascii_glyph_set.dart
index f470fe4..c233bf5 100644
--- a/lib/src/generated/ascii_glyph_set.dart
+++ b/lib/src/generated/ascii_glyph_set.dart
@@ -12,311 +12,372 @@
/// Returns [glyph] if [this] supports Unicode glyphs and [alternative]
/// otherwise.
+ @override
String glyphOrAscii(String glyph, String alternative) => alternative;
/// A bullet point.
///
- /// Always "*" for [this].
- String get bullet => "*";
+ /// Always '*' for [this].
+ @override
+ String get 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.
///
- /// Always "<" for [this].
- String get leftArrow => "<";
+ /// Always '<' for [this].
+ @override
+ 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.
///
- /// Always ">" for [this].
- String get rightArrow => ">";
+ /// Always '>' for [this].
+ @override
+ String get rightArrow => '>';
/// An upwards-pointing arrow.
///
- /// Always "^" for [this].
- String get upArrow => "^";
+ /// Always '^' for [this].
+ @override
+ String get upArrow => '^';
/// A downwards-pointing arrow.
///
- /// Always "v" for [this].
- String get downArrow => "v";
+ /// Always 'v' for [this].
+ @override
+ String get downArrow => 'v';
/// A two-character left-pointing arrow.
///
- /// Always "<=" for [this].
- String get longLeftArrow => "<=";
+ /// Always '<=' for [this].
+ @override
+ String get longLeftArrow => '<=';
/// A two-character right-pointing arrow.
///
- /// Always "=>" for [this].
- String get longRightArrow => "=>";
+ /// Always '=>' for [this].
+ @override
+ String get longRightArrow => '=>';
/// A horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLine => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLine => '-';
/// A vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLine => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLine => '|';
/// The upper left-hand corner of a box.
///
- /// Always "," for [this].
- String get topLeftCorner => ",";
+ /// Always ',' for [this].
+ @override
+ String get topLeftCorner => ',';
/// The upper right-hand corner of a box.
///
- /// Always "," for [this].
- String get topRightCorner => ",";
+ /// Always ',' for [this].
+ @override
+ String get topRightCorner => ',';
/// The lower left-hand corner of a box.
///
/// Always "'" for [this].
+ @override
String get bottomLeftCorner => "'";
/// The lower right-hand corner of a box.
///
/// Always "'" for [this].
+ @override
String get bottomRightCorner => "'";
/// An intersection of vertical and horizontal box lines.
///
- /// Always "+" for [this].
- String get cross => "+";
+ /// Always '+' for [this].
+ @override
+ String get cross => '+';
/// A horizontal box line with a vertical line going up from the middle.
///
- /// Always "+" for [this].
- String get teeUp => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeUp => '+';
/// A horizontal box line with a vertical line going down from the middle.
///
- /// Always "+" for [this].
- String get teeDown => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeDown => '+';
/// A vertical box line with a horizontal line going left from the middle.
///
- /// Always "+" for [this].
- String get teeLeft => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeLeft => '+';
/// A vertical box line with a horizontal line going right from the middle.
///
- /// Always "+" for [this].
- String get teeRight => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeRight => '+';
/// The top half of a vertical box line.
///
/// Always "'" for [this].
+ @override
String get upEnd => "'";
/// The bottom half of a vertical box line.
///
- /// Always "," for [this].
- String get downEnd => ",";
+ /// Always ',' for [this].
+ @override
+ String get downEnd => ',';
/// The left half of a horizontal box line.
///
- /// Always "-" for [this].
- String get leftEnd => "-";
+ /// Always '-' for [this].
+ @override
+ String get leftEnd => '-';
/// The right half of a horizontal box line.
///
- /// Always "-" for [this].
- String get rightEnd => "-";
+ /// Always '-' for [this].
+ @override
+ String get rightEnd => '-';
/// A bold horizontal line that can be used to draw a box.
///
- /// Always "=" for [this].
- String get horizontalLineBold => "=";
+ /// Always '=' for [this].
+ @override
+ String get horizontalLineBold => '=';
/// A bold vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineBold => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineBold => '|';
/// The bold upper left-hand corner of a box.
///
- /// Always "," for [this].
- String get topLeftCornerBold => ",";
+ /// Always ',' for [this].
+ @override
+ String get topLeftCornerBold => ',';
/// The bold upper right-hand corner of a box.
///
- /// Always "," for [this].
- String get topRightCornerBold => ",";
+ /// Always ',' for [this].
+ @override
+ String get topRightCornerBold => ',';
/// The bold lower left-hand corner of a box.
///
/// Always "'" for [this].
+ @override
String get bottomLeftCornerBold => "'";
/// The bold lower right-hand corner of a box.
///
/// Always "'" for [this].
+ @override
String get bottomRightCornerBold => "'";
/// An intersection of bold vertical and horizontal box lines.
///
- /// Always "+" for [this].
- String get crossBold => "+";
+ /// Always '+' for [this].
+ @override
+ String get crossBold => '+';
/// A bold horizontal box line with a vertical line going up from the middle.
///
- /// Always "+" for [this].
- String get teeUpBold => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeUpBold => '+';
/// A bold horizontal box line with a vertical line going down from the middle.
///
- /// Always "+" for [this].
- String get teeDownBold => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeDownBold => '+';
/// A bold vertical box line with a horizontal line going left from the middle.
///
- /// Always "+" for [this].
- String get teeLeftBold => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeLeftBold => '+';
/// A bold vertical box line with a horizontal line going right from the middle.
///
- /// Always "+" for [this].
- String get teeRightBold => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeRightBold => '+';
/// The top half of a bold vertical box line.
///
/// Always "'" for [this].
+ @override
String get upEndBold => "'";
/// The bottom half of a bold vertical box line.
///
- /// Always "," for [this].
- String get downEndBold => ",";
+ /// Always ',' for [this].
+ @override
+ String get downEndBold => ',';
/// The left half of a bold horizontal box line.
///
- /// Always "-" for [this].
- String get leftEndBold => "-";
+ /// Always '-' for [this].
+ @override
+ String get leftEndBold => '-';
/// The right half of a bold horizontal box line.
///
- /// Always "-" for [this].
- String get rightEndBold => "-";
+ /// Always '-' for [this].
+ @override
+ String get rightEndBold => '-';
/// A double horizontal line that can be used to draw a box.
///
- /// Always "=" for [this].
- String get horizontalLineDouble => "=";
+ /// Always '=' for [this].
+ @override
+ String get horizontalLineDouble => '=';
/// A double vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineDouble => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineDouble => '|';
/// The double upper left-hand corner of a box.
///
- /// Always "," for [this].
- String get topLeftCornerDouble => ",";
+ /// Always ',' for [this].
+ @override
+ String get topLeftCornerDouble => ',';
/// The double upper right-hand corner of a box.
///
- /// Always "," for [this].
- String get topRightCornerDouble => ",";
+ /// Always ',' for [this].
+ @override
+ String get topRightCornerDouble => ',';
/// The double lower left-hand corner of a box.
///
/// Always '"' for [this].
+ @override
String get bottomLeftCornerDouble => '"';
/// The double lower right-hand corner of a box.
///
/// Always '"' for [this].
+ @override
String get bottomRightCornerDouble => '"';
/// An intersection of double vertical and horizontal box lines.
///
- /// Always "+" for [this].
- String get crossDouble => "+";
+ /// Always '+' for [this].
+ @override
+ String get crossDouble => '+';
/// A double horizontal box line with a vertical line going up from the middle.
///
- /// Always "+" for [this].
- String get teeUpDouble => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeUpDouble => '+';
/// A double horizontal box line with a vertical line going down from the middle.
///
- /// Always "+" for [this].
- String get teeDownDouble => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeDownDouble => '+';
/// A double vertical box line with a horizontal line going left from the middle.
///
- /// Always "+" for [this].
- String get teeLeftDouble => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeLeftDouble => '+';
/// A double vertical box line with a horizontal line going right from the middle.
///
- /// Always "+" for [this].
- String get teeRightDouble => "+";
+ /// Always '+' for [this].
+ @override
+ String get teeRightDouble => '+';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineDoubleDash => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineDoubleDash => '-';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineDoubleDashBold => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineDoubleDashBold => '-';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineDoubleDash => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineDoubleDash => '|';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineDoubleDashBold => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineDoubleDashBold => '|';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineTripleDash => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineTripleDash => '-';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineTripleDashBold => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineTripleDashBold => '-';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineTripleDash => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineTripleDash => '|';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineTripleDashBold => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineTripleDashBold => '|';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineQuadrupleDash => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineQuadrupleDash => '-';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "-" for [this].
- String get horizontalLineQuadrupleDashBold => "-";
+ /// Always '-' for [this].
+ @override
+ String get horizontalLineQuadrupleDashBold => '-';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineQuadrupleDash => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineQuadrupleDash => '|';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "|" for [this].
- String get verticalLineQuadrupleDashBold => "|";
+ /// Always '|' for [this].
+ @override
+ String get verticalLineQuadrupleDashBold => '|';
}
diff --git a/lib/src/generated/glyph_set.dart b/lib/src/generated/glyph_set.dart
index 93676db..941da4f 100644
--- a/lib/src/generated/glyph_set.dart
+++ b/lib/src/generated/glyph_set.dart
@@ -14,17 +14,17 @@
///
/// /// Adds a vertical line to the left of [text].
/// ///
-/// /// If [ascii] is `true`, this uses plain ASCII for the line. If it's
-/// /// `false`, this uses Unicode characters. If it's `null`, it defaults
-/// /// to [glyph.ascii].
-/// void addVerticalLine(String text, {bool ascii}) {
+/// /// If [unicode] is `true`, this uses Unicode for the line. If it's
+/// /// `false`, this uses plain ASCII characters. If it's `null`, it
+/// /// defaults to [glyph.ascii].
+/// void addVerticalLine(String text, {bool unicode}) {
/// var glyphs =
-/// (ascii ?? glyph.ascii) ? glyph.asciiGlyphs : glyph.unicodeGlyphs;
+/// (unicode ?? !glyph.ascii) ? glyph.unicodeGlyphs : glyph.asciiGlyphs;
///
/// return text
-/// .split("\n")
-/// .map((line) => "${glyphs.verticalLine} $line")
-/// .join("\n");
+/// .split('\n')
+/// .map((line) => '${glyphs.verticalLine} $line')
+/// .join('\n');
/// }
/// ```
abstract class GlyphSet {
diff --git a/lib/src/generated/unicode_glyph_set.dart b/lib/src/generated/unicode_glyph_set.dart
index 4e54068..bc6ad33 100644
--- a/lib/src/generated/unicode_glyph_set.dart
+++ b/lib/src/generated/unicode_glyph_set.dart
@@ -12,311 +12,372 @@
/// Returns [glyph] if [this] supports Unicode glyphs and [alternative]
/// otherwise.
+ @override
String glyphOrAscii(String glyph, String alternative) => glyph;
/// A bullet point.
///
- /// Always "•" for [this].
- String get bullet => "•";
+ /// Always '•' for [this].
+ @override
+ String get 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.
///
- /// Always "←" for [this].
- String get leftArrow => "←";
+ /// Always '←' for [this].
+ @override
+ 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.
///
- /// Always "→" for [this].
- String get rightArrow => "→";
+ /// Always '→' for [this].
+ @override
+ String get rightArrow => '→';
/// An upwards-pointing arrow.
///
- /// Always "↑" for [this].
- String get upArrow => "↑";
+ /// Always '↑' for [this].
+ @override
+ String get upArrow => '↑';
/// A downwards-pointing arrow.
///
- /// Always "↓" for [this].
- String get downArrow => "↓";
+ /// Always '↓' for [this].
+ @override
+ String get downArrow => '↓';
/// A two-character left-pointing arrow.
///
- /// Always "◀━" for [this].
- String get longLeftArrow => "◀━";
+ /// Always '◀━' for [this].
+ @override
+ String get longLeftArrow => '◀━';
/// A two-character right-pointing arrow.
///
- /// Always "━▶" for [this].
- String get longRightArrow => "━▶";
+ /// Always '━▶' for [this].
+ @override
+ String get longRightArrow => '━▶';
/// A horizontal line that can be used to draw a box.
///
- /// Always "─" for [this].
- String get horizontalLine => "─";
+ /// Always '─' for [this].
+ @override
+ String get horizontalLine => '─';
/// A vertical line that can be used to draw a box.
///
- /// Always "│" for [this].
- String get verticalLine => "│";
+ /// Always '│' for [this].
+ @override
+ String get verticalLine => '│';
/// The upper left-hand corner of a box.
///
- /// Always "┌" for [this].
- String get topLeftCorner => "┌";
+ /// Always '┌' for [this].
+ @override
+ String get topLeftCorner => '┌';
/// The upper right-hand corner of a box.
///
- /// Always "┐" for [this].
- String get topRightCorner => "┐";
+ /// Always '┐' for [this].
+ @override
+ String get topRightCorner => '┐';
/// The lower left-hand corner of a box.
///
- /// Always "└" for [this].
- String get bottomLeftCorner => "└";
+ /// Always '└' for [this].
+ @override
+ String get bottomLeftCorner => '└';
/// The lower right-hand corner of a box.
///
- /// Always "┘" for [this].
- String get bottomRightCorner => "┘";
+ /// Always '┘' for [this].
+ @override
+ String get bottomRightCorner => '┘';
/// An intersection of vertical and horizontal box lines.
///
- /// Always "┼" for [this].
- String get cross => "┼";
+ /// Always '┼' for [this].
+ @override
+ String get cross => '┼';
/// A horizontal box line with a vertical line going up from the middle.
///
- /// Always "┴" for [this].
- String get teeUp => "┴";
+ /// Always '┴' for [this].
+ @override
+ String get teeUp => '┴';
/// A horizontal box line with a vertical line going down from the middle.
///
- /// Always "┬" for [this].
- String get teeDown => "┬";
+ /// Always '┬' for [this].
+ @override
+ String get teeDown => '┬';
/// A vertical box line with a horizontal line going left from the middle.
///
- /// Always "┤" for [this].
- String get teeLeft => "┤";
+ /// Always '┤' for [this].
+ @override
+ String get teeLeft => '┤';
/// A vertical box line with a horizontal line going right from the middle.
///
- /// Always "├" for [this].
- String get teeRight => "├";
+ /// Always '├' for [this].
+ @override
+ String get teeRight => '├';
/// The top half of a vertical box line.
///
- /// Always "╵" for [this].
- String get upEnd => "╵";
+ /// Always '╵' for [this].
+ @override
+ String get upEnd => '╵';
/// The bottom half of a vertical box line.
///
- /// Always "╷" for [this].
- String get downEnd => "╷";
+ /// Always '╷' for [this].
+ @override
+ String get downEnd => '╷';
/// The left half of a horizontal box line.
///
- /// Always "╴" for [this].
- String get leftEnd => "╴";
+ /// Always '╴' for [this].
+ @override
+ String get leftEnd => '╴';
/// The right half of a horizontal box line.
///
- /// Always "╶" for [this].
- String get rightEnd => "╶";
+ /// Always '╶' for [this].
+ @override
+ String get rightEnd => '╶';
/// A bold horizontal line that can be used to draw a box.
///
- /// Always "━" for [this].
- String get horizontalLineBold => "━";
+ /// Always '━' for [this].
+ @override
+ String get horizontalLineBold => '━';
/// A bold vertical line that can be used to draw a box.
///
- /// Always "┃" for [this].
- String get verticalLineBold => "┃";
+ /// Always '┃' for [this].
+ @override
+ String get verticalLineBold => '┃';
/// The bold upper left-hand corner of a box.
///
- /// Always "┏" for [this].
- String get topLeftCornerBold => "┏";
+ /// Always '┏' for [this].
+ @override
+ String get topLeftCornerBold => '┏';
/// The bold upper right-hand corner of a box.
///
- /// Always "┓" for [this].
- String get topRightCornerBold => "┓";
+ /// Always '┓' for [this].
+ @override
+ String get topRightCornerBold => '┓';
/// The bold lower left-hand corner of a box.
///
- /// Always "┗" for [this].
- String get bottomLeftCornerBold => "┗";
+ /// Always '┗' for [this].
+ @override
+ String get bottomLeftCornerBold => '┗';
/// The bold lower right-hand corner of a box.
///
- /// Always "┛" for [this].
- String get bottomRightCornerBold => "┛";
+ /// Always '┛' for [this].
+ @override
+ String get bottomRightCornerBold => '┛';
/// An intersection of bold vertical and horizontal box lines.
///
- /// Always "╋" for [this].
- String get crossBold => "╋";
+ /// Always '╋' for [this].
+ @override
+ String get crossBold => '╋';
/// A bold horizontal box line with a vertical line going up from the middle.
///
- /// Always "┻" for [this].
- String get teeUpBold => "┻";
+ /// Always '┻' for [this].
+ @override
+ String get teeUpBold => '┻';
/// A bold horizontal box line with a vertical line going down from the middle.
///
- /// Always "┳" for [this].
- String get teeDownBold => "┳";
+ /// Always '┳' for [this].
+ @override
+ String get teeDownBold => '┳';
/// A bold vertical box line with a horizontal line going left from the middle.
///
- /// Always "┫" for [this].
- String get teeLeftBold => "┫";
+ /// Always '┫' for [this].
+ @override
+ String get teeLeftBold => '┫';
/// A bold vertical box line with a horizontal line going right from the middle.
///
- /// Always "┣" for [this].
- String get teeRightBold => "┣";
+ /// Always '┣' for [this].
+ @override
+ String get teeRightBold => '┣';
/// The top half of a bold vertical box line.
///
- /// Always "╹" for [this].
- String get upEndBold => "╹";
+ /// Always '╹' for [this].
+ @override
+ String get upEndBold => '╹';
/// The bottom half of a bold vertical box line.
///
- /// Always "╻" for [this].
- String get downEndBold => "╻";
+ /// Always '╻' for [this].
+ @override
+ String get downEndBold => '╻';
/// The left half of a bold horizontal box line.
///
- /// Always "╸" for [this].
- String get leftEndBold => "╸";
+ /// Always '╸' for [this].
+ @override
+ String get leftEndBold => '╸';
/// The right half of a bold horizontal box line.
///
- /// Always "╺" for [this].
- String get rightEndBold => "╺";
+ /// Always '╺' for [this].
+ @override
+ String get rightEndBold => '╺';
/// A double horizontal line that can be used to draw a box.
///
- /// Always "═" for [this].
- String get horizontalLineDouble => "═";
+ /// Always '═' for [this].
+ @override
+ String get horizontalLineDouble => '═';
/// A double vertical line that can be used to draw a box.
///
- /// Always "║" for [this].
- String get verticalLineDouble => "║";
+ /// Always '║' for [this].
+ @override
+ String get verticalLineDouble => '║';
/// The double upper left-hand corner of a box.
///
- /// Always "╔" for [this].
- String get topLeftCornerDouble => "╔";
+ /// Always '╔' for [this].
+ @override
+ String get topLeftCornerDouble => '╔';
/// The double upper right-hand corner of a box.
///
- /// Always "╗" for [this].
- String get topRightCornerDouble => "╗";
+ /// Always '╗' for [this].
+ @override
+ String get topRightCornerDouble => '╗';
/// The double lower left-hand corner of a box.
///
- /// Always "╚" for [this].
- String get bottomLeftCornerDouble => "╚";
+ /// Always '╚' for [this].
+ @override
+ String get bottomLeftCornerDouble => '╚';
/// The double lower right-hand corner of a box.
///
- /// Always "╝" for [this].
- String get bottomRightCornerDouble => "╝";
+ /// Always '╝' for [this].
+ @override
+ String get bottomRightCornerDouble => '╝';
/// An intersection of double vertical and horizontal box lines.
///
- /// Always "╬" for [this].
- String get crossDouble => "╬";
+ /// Always '╬' for [this].
+ @override
+ String get crossDouble => '╬';
/// A double horizontal box line with a vertical line going up from the middle.
///
- /// Always "╩" for [this].
- String get teeUpDouble => "╩";
+ /// Always '╩' for [this].
+ @override
+ String get teeUpDouble => '╩';
/// A double horizontal box line with a vertical line going down from the middle.
///
- /// Always "╦" for [this].
- String get teeDownDouble => "╦";
+ /// Always '╦' for [this].
+ @override
+ String get teeDownDouble => '╦';
/// A double vertical box line with a horizontal line going left from the middle.
///
- /// Always "╣" for [this].
- String get teeLeftDouble => "╣";
+ /// Always '╣' for [this].
+ @override
+ String get teeLeftDouble => '╣';
/// A double vertical box line with a horizontal line going right from the middle.
///
- /// Always "╠" for [this].
- String get teeRightDouble => "╠";
+ /// Always '╠' for [this].
+ @override
+ String get teeRightDouble => '╠';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "╌" for [this].
- String get horizontalLineDoubleDash => "╌";
+ /// Always '╌' for [this].
+ @override
+ String get horizontalLineDoubleDash => '╌';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "╍" for [this].
- String get horizontalLineDoubleDashBold => "╍";
+ /// Always '╍' for [this].
+ @override
+ String get horizontalLineDoubleDashBold => '╍';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "╎" for [this].
- String get verticalLineDoubleDash => "╎";
+ /// Always '╎' for [this].
+ @override
+ String get verticalLineDoubleDash => '╎';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "╏" for [this].
- String get verticalLineDoubleDashBold => "╏";
+ /// Always '╏' for [this].
+ @override
+ String get verticalLineDoubleDashBold => '╏';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "┄" for [this].
- String get horizontalLineTripleDash => "┄";
+ /// Always '┄' for [this].
+ @override
+ String get horizontalLineTripleDash => '┄';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "┅" for [this].
- String get horizontalLineTripleDashBold => "┅";
+ /// Always '┅' for [this].
+ @override
+ String get horizontalLineTripleDashBold => '┅';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "┆" for [this].
- String get verticalLineTripleDash => "┆";
+ /// Always '┆' for [this].
+ @override
+ String get verticalLineTripleDash => '┆';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "┇" for [this].
- String get verticalLineTripleDashBold => "┇";
+ /// Always '┇' for [this].
+ @override
+ String get verticalLineTripleDashBold => '┇';
/// A dashed horizontal line that can be used to draw a box.
///
- /// Always "┈" for [this].
- String get horizontalLineQuadrupleDash => "┈";
+ /// Always '┈' for [this].
+ @override
+ String get horizontalLineQuadrupleDash => '┈';
/// A bold dashed horizontal line that can be used to draw a box.
///
- /// Always "┉" for [this].
- String get horizontalLineQuadrupleDashBold => "┉";
+ /// Always '┉' for [this].
+ @override
+ String get horizontalLineQuadrupleDashBold => '┉';
/// A dashed vertical line that can be used to draw a box.
///
- /// Always "┊" for [this].
- String get verticalLineQuadrupleDash => "┊";
+ /// Always '┊' for [this].
+ @override
+ String get verticalLineQuadrupleDash => '┊';
/// A bold dashed vertical line that can be used to draw a box.
///
- /// Always "┋" for [this].
- String get verticalLineQuadrupleDashBold => "┋";
+ /// Always '┋' for [this].
+ @override
+ String get verticalLineQuadrupleDashBold => '┋';
}
diff --git a/test/symbol_test.dart b/test/symbol_test.dart
index 1e665e8..22993a7 100644
--- a/test/symbol_test.dart
+++ b/test/symbol_test.dart
@@ -7,55 +7,55 @@
import 'package:term_glyph/term_glyph.dart' as glyph;
void main() {
- group("with ascii = false", () {
+ group('with ascii = false', () {
setUpAll(() {
glyph.ascii = false;
});
- test("glyph getters return Unicode versions", () {
- expect(glyph.topLeftCorner, equals("┌"));
- expect(glyph.teeUpBold, equals("┻"));
- expect(glyph.longLeftArrow, equals("◀━"));
+ test('glyph getters return Unicode versions', () {
+ expect(glyph.topLeftCorner, equals('┌'));
+ expect(glyph.teeUpBold, equals('┻'));
+ expect(glyph.longLeftArrow, equals('◀━'));
});
- test("glyphOrAscii returns the first argument", () {
- expect(glyph.glyphOrAscii("A", "B"), equals("A"));
+ test('glyphOrAscii returns the first argument', () {
+ expect(glyph.glyphOrAscii('A', 'B'), equals('A'));
});
- test("glyphs returns unicodeGlyphs", () {
+ test('glyphs returns unicodeGlyphs', () {
expect(glyph.glyphs, equals(glyph.unicodeGlyphs));
});
- test("asciiGlyphs still returns ASCII characters", () {
- expect(glyph.asciiGlyphs.topLeftCorner, equals(","));
- expect(glyph.asciiGlyphs.teeUpBold, equals("+"));
- expect(glyph.asciiGlyphs.longLeftArrow, equals("<="));
+ test('asciiGlyphs still returns ASCII characters', () {
+ expect(glyph.asciiGlyphs.topLeftCorner, equals(','));
+ expect(glyph.asciiGlyphs.teeUpBold, equals('+'));
+ expect(glyph.asciiGlyphs.longLeftArrow, equals('<='));
});
});
- group("with ascii = true", () {
+ group('with ascii = true', () {
setUpAll(() {
glyph.ascii = true;
});
- test("glyphs return ASCII versions", () {
- expect(glyph.topLeftCorner, equals(","));
- expect(glyph.teeUpBold, equals("+"));
- expect(glyph.longLeftArrow, equals("<="));
+ test('glyphs return ASCII versions', () {
+ expect(glyph.topLeftCorner, equals(','));
+ expect(glyph.teeUpBold, equals('+'));
+ expect(glyph.longLeftArrow, equals('<='));
});
- test("glyphOrAscii returns the second argument", () {
- expect(glyph.glyphOrAscii("A", "B"), equals("B"));
+ test('glyphOrAscii returns the second argument', () {
+ expect(glyph.glyphOrAscii('A', 'B'), equals('B'));
});
- test("glyphs returns asciiGlyphs", () {
+ test('glyphs returns asciiGlyphs', () {
expect(glyph.glyphs, equals(glyph.asciiGlyphs));
});
- test("unicodeGlyphs still returns Unicode characters", () {
- expect(glyph.unicodeGlyphs.topLeftCorner, equals("┌"));
- expect(glyph.unicodeGlyphs.teeUpBold, equals("┻"));
- expect(glyph.unicodeGlyphs.longLeftArrow, equals("◀━"));
+ test('unicodeGlyphs still returns Unicode characters', () {
+ expect(glyph.unicodeGlyphs.topLeftCorner, equals('┌'));
+ expect(glyph.unicodeGlyphs.teeUpBold, equals('┻'));
+ expect(glyph.unicodeGlyphs.longLeftArrow, equals('◀━'));
});
});
}
diff --git a/tool/generate.dart b/tool/generate.dart
index 370994f..04a919b 100644
--- a/tool/generate.dart
+++ b/tool/generate.dart
@@ -8,13 +8,13 @@
import 'package:meta/meta.dart';
void main() {
- var csv = CsvCodec(eol: "\n");
- var data = csv.decoder.convert(File("data.csv").readAsStringSync());
+ var csv = CsvCodec(eol: '\n');
+ var data = csv.decoder.convert(File('data.csv').readAsStringSync());
// Remove comments and empty lines.
data.removeWhere((row) => row.length < 3);
- Directory("lib/src/generated").createSync(recursive: true);
+ Directory('lib/src/generated').createSync(recursive: true);
_writeGlyphSetInterface(data);
_writeGlyphSet(data, ascii: false);
@@ -22,7 +22,7 @@
_writeTopLevel(data);
var result = Process.runSync(
- "pub", ["run", "dart_style:format", "-w", "lib/src/generated"]);
+ 'pub', ['run', 'dart_style:format', '-w', 'lib/src/generated']);
print(result.stderr);
exit(result.exitCode);
}
@@ -30,8 +30,8 @@
/// Writes `lib/src/generated/glyph_set.dart`.
void _writeGlyphSetInterface(List<List> data) {
var file =
- File("lib/src/generated/glyph_set.dart").openSync(mode: FileMode.write);
- file.writeStringSync(r"""
+ File('lib/src/generated/glyph_set.dart').openSync(mode: FileMode.write);
+ 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.
@@ -56,26 +56,26 @@
/// (unicode ?? !glyph.ascii) ? glyph.unicodeGlyphs : glyph.asciiGlyphs;
///
/// return text
- /// .split("\n")
- /// .map((line) => "${glyphs.verticalLine} $line")
- /// .join("\n");
+ /// .split('\n')
+ /// .map((line) => '${glyphs.verticalLine} $line')
+ /// .join('\n');
/// }
/// ```
abstract class GlyphSet {
/// Returns [glyph] if [this] supports Unicode glyphs and [alternative]
/// otherwise.
String glyphOrAscii(String glyph, String alternative);
- """);
+ ''');
for (var glyph in data) {
- for (var line in glyph[3].split("\n")) {
- file.writeStringSync("/// $line\n");
+ for (var line in glyph[3].split('\n')) {
+ file.writeStringSync('/// $line\n');
}
- file.writeStringSync("String get ${glyph[0]};");
+ file.writeStringSync('String get ${glyph[0]};');
}
- file.writeStringSync("}");
+ file.writeStringSync('}');
file.closeSync();
}
@@ -85,11 +85,11 @@
/// the Unicode glyph set.
void _writeGlyphSet(List<List> data, {@required bool ascii}) {
var file =
- File("lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart")
+ File('lib/src/generated/${ascii ? "ascii" : "unicode"}_glyph_set.dart')
.openSync(mode: FileMode.write);
- var className = "${ascii ? "Ascii" : "Unicode"}GlyphSet";
- file.writeStringSync("""
+ var 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.
@@ -103,33 +103,35 @@
const $className();
/// Returns [glyph] if [this] supports Unicode glyphs and [alternative]
/// otherwise.
+ @override
String glyphOrAscii(String glyph, String alternative) =>
${ascii ? "alternative" : "glyph"};
- """);
+ ''');
var index = ascii ? 2 : 1;
for (var glyph in data) {
- for (var line in glyph[3].split("\n")) {
- file.writeStringSync("/// $line\n");
+ for (var line in glyph[3].split('\n')) {
+ file.writeStringSync('/// $line\n');
}
- file.writeStringSync("""
+ file.writeStringSync('''
///
/// Always ${_quote(glyph[index])} for [this].
+ @override
String get ${glyph[0]} => ${_quote(glyph[index])};
- """);
+ ''');
}
- file.writeStringSync("}");
+ file.writeStringSync('}');
file.closeSync();
}
/// Writes `lib/src/generated/top_level.dart`.
void _writeTopLevel(List<List> data) {
var file =
- File("lib/src/generated/top_level.dart").openSync(mode: FileMode.write);
+ File('lib/src/generated/top_level.dart').openSync(mode: FileMode.write);
- file.writeStringSync("""
+ 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.
@@ -137,22 +139,22 @@
// Don't modify this file by hand! It's generated by tool/generate.dart.
import '../../term_glyph.dart' as glyph;
- """);
+ ''');
for (var glyph in data) {
- for (var line in glyph[3].split("\n")) {
- file.writeStringSync("/// $line\n");
+ for (var line in glyph[3].split('\n')) {
+ file.writeStringSync('/// $line\n');
}
- file.writeStringSync("""
+ file.writeStringSync('''
///
/// If [ascii] is `false`, this is "${glyph[1]}". If it's `true`, this is
/// "${glyph[2]}" instead.
String get ${glyph[0]} => glyph.glyphs.${glyph[0]};
- """);
+ ''');
}
file.closeSync();
}
-String _quote(String input) => input.contains('"') ? "'$input'" : '"$input"';
+String _quote(String input) => input.contains("'") ? '"$input"' : "'$input'";