Switch to github actions.
Fix formatting.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..d4e9e25
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,60 @@
+name: Dart CI
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ master ]
+ schedule:
+ - cron: "0 0 * * 0"
+
+env:
+ PUB_ENVIRONMENT: bot.github
+
+jobs:
+ # Check code formatting and static analysis on a single OS (linux)
+ # against Dart dev.
+ analyze:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ sdk: [dev]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dart-lang/setup-dart@v1.0
+ with:
+ sdk: ${{ matrix.sdk }}
+ - id: install
+ name: Install dependencies
+ run: dart pub get
+ - name: Check formatting
+ run: dart format --output=none --set-exit-if-changed .
+ if: always() && steps.install.outcome == 'success'
+ - name: Analyze code
+ run: dart analyze --fatal-infos
+ if: always() && steps.install.outcome == 'success'
+
+ # Run tests on a matrix consisting of two dimensions:
+ # 1. OS: ubuntu-latest
+ # 2. release channel: dev
+ test:
+ needs: analyze
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # Add macos-latest and/or windows-latest if relevant for this package.
+ os: [ubuntu-latest]
+ sdk: [2.12.0, dev]
+ steps:
+ - uses: actions/checkout@v2
+ - uses: dart-lang/setup-dart@v1.0
+ with:
+ sdk: ${{ matrix.sdk }}
+ - id: install
+ name: Install dependencies
+ run: dart pub get
+ - name: Run VM tests
+ run: dart test --platform vm --test-randomize-ordering-seed=random
+ if: always() && steps.install.outcome == 'success'
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4fceea8..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-language: dart
-
-dart:
- - preview/raw/2.10.0-0.2-dev
-
-dart_task:
- - dart_analyzer: --enable-experiment=non-nullable --fatal-warnings --fatal-infos .
-
-matrix:
- include:
- # Only validate formatting using the dev release
- - dart: preview/raw/2.10.0-0.2-dev
- dart_task: dartfmt
-
-# Only building master means that we don't run two builds for each pull request.
-branches:
- only: [master]
-
-cache:
- directories:
- - $HOME/.pub-cache
diff --git a/bin/charcode.dart b/bin/charcode.dart
index 3acadb4..2053fde 100644
--- a/bin/charcode.dart
+++ b/bin/charcode.dart
@@ -147,7 +147,6 @@
/// A single declaration to be written to the output.
class Entry implements Comparable<Entry> {
-
/// The code point.
final int charCode;
@@ -196,6 +195,7 @@
class CharacterDeclaration {
/// The unprefixed name to use for the code point.
final String name;
+
/// An optional description.
final String? description;
CharacterDeclaration(this.name, this.description);
@@ -332,7 +332,8 @@
"(U+${charCode.toRadixString(16).toUpperCase().padLeft(4, "0")})");
return false;
}
- _entries.add(Entry(charCode, declaration.name, prefix, declaration.description));
+ _entries.add(
+ Entry(charCode, declaration.name, prefix, declaration.description));
_entryNames.add(name);
return true;
}
diff --git a/bin/src/uflags.dart b/bin/src/uflags.dart
index 2a0c6e7..acdac37 100644
--- a/bin/src/uflags.dart
+++ b/bin/src/uflags.dart
@@ -424,8 +424,7 @@
if (bytes[start] == $dash) start++;
if (bytes[end - 1] == $dash) end--;
}
- return String.fromCharCodes(
- Uint8List.sublistView(bytes, start, end));
+ return String.fromCharCodes(Uint8List.sublistView(bytes, start, end));
}
return upperCase == 0 ? name.toLowerCase() : name;
}