Skip to content

Commit

Permalink
Use dart_dev to format so that
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Oct 2, 2023
1 parent 40a2e19 commit ff5b121
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/dart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: always() && steps.install.outcome == 'success'

- name: Verify formatting
run: dart format --output=none --line-length=120 --set-exit-if-changed .
run: dart run dart_dev format --check
if: ${{ matrix.sdk == '2.18.7' }}

- name: Analyze project source
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dev_dependencies:
build_runner: ^2.1.2
build_test: ^2.1.3
build_web_compilers: ^3.0.0
dart_dev: ^4.0.0
dependency_validator: ^3.2.2
matcher: ^0.12.11
mockito: ^5.3.1
Expand Down
25 changes: 25 additions & 0 deletions tool/dart_dev/config.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2023 Workiva Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import 'package:dart_dev/dart_dev.dart';
import 'package:glob/glob.dart';

final config = {
'format': FormatTool()
..formatterArgs = ['--line-length=120']
..exclude = [
// Don't format generated mockito files.
Glob('test/mockito.mocks.dart'),
],
};

0 comments on commit ff5b121

Please sign in to comment.