Skip to content

Commit

Permalink
small housekeeping
Browse files Browse the repository at this point in the history
- add github actions to run linter and test for PR
- update analysis_options.yaml more pedantic
- address linter warning
-
  • Loading branch information
i10416 committed Feb 27, 2022
1 parent c4344e0 commit 1a4b35d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 57 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test
on:
pull_request:
types: [opened, synchronize]
push:
branches: [ master ]
jobs:
test:
name: test
runs-on: ubuntu-latest
container:
image: google/dart:latest
steps:
- name: set up repository
uses: actions/checkout@v2
- name: install deps
run: pub get
- name: analyzer
run: dartanalyzer --fatal-warnings --fatal-infos .
- name: test
run: dart test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

19 changes: 18 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,21 @@ linter:
rules:
unawaited_futures: true
curly_braces_in_flow_control_structures: true
avoid_catches_without_on_clauses: true
avoid_catches_without_on_clauses: true
avoid_empty_else: true
avoid_print: true
empty_catches: true
prefer_const_constructors_in_immutables: true
prefer_const_constructors: true
prefer_const_declarations: true
unnecessary_const: true
prefer_final_fields: true
prefer_null_aware_operators: true
provide_deprecation_message: true
unnecessary_new: true
unnecessary_null_aware_assignments: true
unnecessary_null_in_if_null_operators: true
unnecessary_overrides: true
unnecessary_parenthesis: true
unnecessary_statements: true
valid_regexps: true
13 changes: 6 additions & 7 deletions test/parser_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ void main() {
fail('Did not throw.');
} on Exception catch (ex, st) {
if (ex is! TemplateException) {
// ignore: avoid_print
print(ex);
// ignore: avoid_print
print(st);
}
return ex;
Expand Down Expand Up @@ -381,28 +383,25 @@ bool nodeEqual(a, b) {
a.start == b.start &&
a.end == b.end;
} else if (a is VariableNode) {
return a is VariableNode &&
a.name == b.name &&
return a.name == b.name &&
a.escape == b.escape &&
a.start == b.start &&
a.end == b.end;
} else if (a is SectionNode) {
return a is SectionNode &&
a.name == b.name &&
return a.name == b.name &&
a.delimiters == b.delimiters &&
a.inverse == b.inverse &&
a.start == b.start &&
a.end == b.end;
} else if (a is PartialNode) {
return a is PartialNode && a.name == b.name && a.indent == b.indent;
return a.name == b.name && a.indent == b.indent;
} else {
return false;
}
}

bool tokenEqual(Token a, Token b) {
return a is Token &&
a.type == b.type &&
return a.type == b.type &&
a.value == b.value &&
a.start == b.start &&
a.end == b.end;
Expand Down
42 changes: 0 additions & 42 deletions tool/travis.sh

This file was deleted.

0 comments on commit 1a4b35d

Please sign in to comment.