Skip to content

Commit

Permalink
add dart code max_line_length to .editorconfig vscode/settings
Browse files Browse the repository at this point in the history
  • Loading branch information
boyan01 committed Jul 19, 2020
1 parent 843c08b commit 87c6f29
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 19 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
charset = utf-8
end_of_line = crlf
indent_size = 4
indent_style = space
insert_final_newline = false
max_line_length = 100
tab_width = 4

[*.dart]
max_line_length = 120

[*.yaml]
indent_size = 2
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -20,6 +20,9 @@ jobs:
- run: flutter config --enable-web
- run: flutter pub get

- name: Project format check
run: flutter format -l 120 -n .

- name: Flutter unit test
run: flutter test --coverage --coverage-path=lcov.info

Expand Down
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
},
"dart.lineLength": 120
}
5 changes: 5 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linter:
# TODO: add more rules
rules:
- avoid_empty_else
# - lines_longer_than_80_chars # not yet tested
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
.pub-cache/
.pub/
build/
.flutter-plugins-dependencies

# Android related
**/android/**/gradle-wrapper.jar
Expand Down
3 changes: 1 addition & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class _NavigationTiles extends StatelessWidget {
ListTile(
title: Text("Star On GitHub"),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(builder: (context) => PageWithIme()));
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PageWithIme()));
},
)
],
Expand Down
24 changes: 8 additions & 16 deletions test/overlay_support_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ void main() {
await tester.pumpWidget(_FakeOverlay(child: Builder(builder: (context) {
return FlatButton(
onPressed: () {
entry =
showSimpleNotification(Text('message'), autoDismiss: false);
entry = showSimpleNotification(Text('message'), autoDismiss: false);
},
child: Text('notification'));
})));
Expand All @@ -95,8 +94,7 @@ void main() {
await tester.pumpWidget(_FakeOverlay(child: Builder(builder: (context) {
return FlatButton(
onPressed: () {
final entry =
showSimpleNotification(Text('message'), autoDismiss: false);
final entry = showSimpleNotification(Text('message'), autoDismiss: false);
//dismiss immediately
entry.dismiss();
},
Expand Down Expand Up @@ -163,14 +161,12 @@ void main() {
children: <Widget>[
FlatButton(
onPressed: () {
showSimpleNotification(Text('message'),
autoDismiss: false, key: ValueKey('hello'));
showSimpleNotification(Text('message'), autoDismiss: false, key: ValueKey('hello'));
},
child: Text('notification')),
FlatButton(
onPressed: () {
showSimpleNotification(Text('message2'),
autoDismiss: false, key: ValueKey('hello'));
showSimpleNotification(Text('message2'), autoDismiss: false, key: ValueKey('hello'));
},
child: Text('notification2')),
],
Expand Down Expand Up @@ -203,14 +199,12 @@ void main() {
children: <Widget>[
FlatButton(
onPressed: () {
showSimpleNotification(Text('message'),
autoDismiss: false, key: ModalKey('hello'));
showSimpleNotification(Text('message'), autoDismiss: false, key: ModalKey('hello'));
},
child: Text('notification')),
FlatButton(
onPressed: () {
showSimpleNotification(Text('message2'),
autoDismiss: false, key: ModalKey('hello'));
showSimpleNotification(Text('message2'), autoDismiss: false, key: ModalKey('hello'));
},
child: Text('notification2')),
],
Expand All @@ -237,8 +231,7 @@ void main() {
await tester.pumpWidget(_FakeOverlay(child: Builder(builder: (context) {
return FlatButton(
onPressed: () {
showSimpleNotification(Text('message'),
trailing: Builder(builder: (context) {
showSimpleNotification(Text('message'), trailing: Builder(builder: (context) {
return FlatButton(
onPressed: () {
entry = OverlaySupportEntry.of(context);
Expand All @@ -265,8 +258,7 @@ void main() {
await tester.pumpWidget(_FakeOverlay(child: Builder(builder: (context) {
return FlatButton(
onPressed: () {
entry =
showSimpleNotification(Text('message'), autoDismiss: true);
entry = showSimpleNotification(Text('message'), autoDismiss: true);
},
child: Text('notification'));
})));
Expand Down

0 comments on commit 87c6f29

Please sign in to comment.