Skip to content

Commit 19f6f2a

Browse files
authored
chore: Update lints, require Dart 3, allow latest pkg:http (#395)
1 parent f433a8e commit 19f6f2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+138
-117
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v6.5.4
1+
# Created with package:mono_repo v6.5.6
22
name: Dart Lint CI
33
on:
44
push:
@@ -35,27 +35,27 @@ jobs:
3535
name: Checkout repository
3636
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
3737
- name: mono_repo self validate
38-
run: dart pub global activate mono_repo 6.5.4
38+
run: dart pub global activate mono_repo 6.5.6
3939
- name: mono_repo self validate
4040
run: dart pub global run mono_repo generate --validate
4141
job_002:
42-
name: "analyze_format; Dart 2.18.0; PKGS: dartfn, functions_framework, functions_framework_builder, gcp; `dart analyze`"
42+
name: "analyze_format; Dart 3.0.0; PKGS: dartfn, functions_framework, functions_framework_builder, gcp; `dart analyze`"
4343
runs-on: ubuntu-latest
4444
steps:
4545
- name: Cache Pub hosted dependencies
4646
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
4747
with:
4848
path: "~/.pub-cache/hosted"
49-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:dartfn-functions_framework-functions_framework_builder-gcp;commands:analyze_1"
49+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:dartfn-functions_framework-functions_framework_builder-gcp;commands:analyze_1"
5050
restore-keys: |
51-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:dartfn-functions_framework-functions_framework_builder-gcp
52-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0
51+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:dartfn-functions_framework-functions_framework_builder-gcp
52+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
5353
os:ubuntu-latest;pub-cache-hosted
5454
os:ubuntu-latest
5555
- name: Setup Dart SDK
5656
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
5757
with:
58-
sdk: "2.18.0"
58+
sdk: "3.0.0"
5959
- id: checkout
6060
name: Checkout repository
6161
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

.github/workflows/unit.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v6.5.4
1+
# Created with package:mono_repo v6.5.6
22
name: Dart Unit CI
33
on:
44
push:
@@ -16,23 +16,23 @@ permissions: read-all
1616

1717
jobs:
1818
job_001:
19-
name: "unit_test; linux; Dart 2.18.0; PKGS: dartfn, functions_framework_builder, gcp, integration_test; `dart test`"
19+
name: "unit_test; linux; Dart 3.0.0; PKGS: dartfn, functions_framework_builder, gcp, integration_test; `dart test`"
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Cache Pub hosted dependencies
2323
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
2424
with:
2525
path: "~/.pub-cache/hosted"
26-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:dartfn-functions_framework_builder-gcp-integration_test;commands:test_0"
26+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:dartfn-functions_framework_builder-gcp-integration_test;commands:test_0"
2727
restore-keys: |
28-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:dartfn-functions_framework_builder-gcp-integration_test
29-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0
28+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:dartfn-functions_framework_builder-gcp-integration_test
29+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
3030
os:ubuntu-latest;pub-cache-hosted
3131
os:ubuntu-latest
3232
- name: Setup Dart SDK
3333
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
3434
with:
35-
sdk: "2.18.0"
35+
sdk: "3.0.0"
3636
- id: checkout
3737
name: Checkout repository
3838
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
@@ -73,23 +73,23 @@ jobs:
7373
if: "always() && steps.integration_test_pub_upgrade.conclusion == 'success'"
7474
working-directory: integration_test
7575
job_002:
76-
name: "unit_test; linux; Dart 2.18.0; PKG: gcp; `./tool/docker_test_script.sh`"
76+
name: "unit_test; linux; Dart 3.0.0; PKG: gcp; `./tool/docker_test_script.sh`"
7777
runs-on: ubuntu-latest
7878
steps:
7979
- name: Cache Pub hosted dependencies
8080
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
8181
with:
8282
path: "~/.pub-cache/hosted"
83-
key: "os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:gcp;commands:command"
83+
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:gcp;commands:command"
8484
restore-keys: |
85-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0;packages:gcp
86-
os:ubuntu-latest;pub-cache-hosted;sdk:2.18.0
85+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:gcp
86+
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
8787
os:ubuntu-latest;pub-cache-hosted
8888
os:ubuntu-latest
8989
- name: Setup Dart SDK
9090
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
9191
with:
92-
sdk: "2.18.0"
92+
sdk: "3.0.0"
9393
- id: checkout
9494
name: Checkout repository
9595
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
@@ -208,23 +208,23 @@ jobs:
208208
if: "always() && steps.integration_test_pub_upgrade.conclusion == 'success'"
209209
working-directory: integration_test
210210
job_005:
211-
name: "unit_test; macos; Dart 2.18.0; PKG: gcp; `dart test`"
211+
name: "unit_test; macos; Dart 3.0.0; PKG: gcp; `dart test`"
212212
runs-on: macos-latest
213213
steps:
214214
- name: Cache Pub hosted dependencies
215215
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
216216
with:
217217
path: "~/.pub-cache/hosted"
218-
key: "os:macos-latest;pub-cache-hosted;sdk:2.18.0;packages:gcp;commands:test_0"
218+
key: "os:macos-latest;pub-cache-hosted;sdk:3.0.0;packages:gcp;commands:test_0"
219219
restore-keys: |
220-
os:macos-latest;pub-cache-hosted;sdk:2.18.0;packages:gcp
221-
os:macos-latest;pub-cache-hosted;sdk:2.18.0
220+
os:macos-latest;pub-cache-hosted;sdk:3.0.0;packages:gcp
221+
os:macos-latest;pub-cache-hosted;sdk:3.0.0
222222
os:macos-latest;pub-cache-hosted
223223
os:macos-latest
224224
- name: Setup Dart SDK
225225
uses: dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
226226
with:
227-
sdk: "2.18.0"
227+
sdk: "3.0.0"
228228
- id: checkout
229229
name: Checkout repository
230230
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab

analysis_options.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# https://dart.dev/guides/language/analysis-options
2-
include: package:lints/recommended.yaml
2+
include: package:dart_flutter_team_lints/analysis_options.yaml
33

44
analyzer:
55
language:
@@ -9,11 +9,8 @@ analyzer:
99

1010
linter:
1111
rules:
12-
- always_declare_return_types
1312
- avoid_bool_literals_in_conditional_expressions
14-
- avoid_catching_errors
1513
- avoid_classes_with_only_static_members
16-
- avoid_dynamic_calls
1714
- avoid_private_typedef_functions
1815
- avoid_redundant_argument_values
1916
- avoid_returning_null
@@ -23,31 +20,17 @@ linter:
2320
- cancel_subscriptions
2421
- cascade_invocations
2522
- comment_references
26-
- directives_ordering
2723
- join_return_with_assignment
28-
- lines_longer_than_80_chars
2924
- literal_only_boolean_expressions
3025
- missing_whitespace_between_adjacent_strings
3126
- no_runtimeType_toString
32-
- omit_local_variable_types
33-
- only_throw_errors
3427
- package_api_docs
35-
- prefer_asserts_in_initializer_lists
3628
- prefer_const_constructors
3729
- prefer_const_declarations
3830
- prefer_expression_function_bodies
3931
- prefer_final_locals
4032
- prefer_relative_imports
41-
- prefer_single_quotes
4233
- require_trailing_commas
43-
- sort_pub_dependencies
4434
- test_types_in_equals
45-
- throw_in_finally
46-
- type_annotate_public_apis
47-
- unawaited_futures
48-
- unnecessary_lambdas
49-
- unnecessary_parenthesis
50-
- unnecessary_statements
51-
- use_is_even_rather_than_modulo
5235
- use_string_buffers
5336
- use_super_parameters

dartfn/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## 0.4.6-dev
22

33
- Ignore file cleanup.
4-
- Require Dart 2.18
4+
- Require Dart 3.0
5+
- Support `package:http` v1
56

67
## 0.4.5
78

dartfn/lib/functions_framework_tool.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
library functions_framework_tool;
16-
1715
export 'src/generators.dart';
1816
export 'src/printer.dart';
1917
export 'src/version.dart';

dartfn/lib/src/generators/cloudevent.g.dart

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dartfn/lib/src/generators/helloworld.g.dart

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dartfn/lib/src/generators/json.g.dart

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dartfn/lib/src/stagehand/common.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// license that can be found in the LICENSE file.
44

55
/// Some utility methods for stagehand.
6+
library;
7+
68
import 'dart:convert' show base64, utf8;
79

810
import 'stagehand.dart';

dartfn/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ version: 0.4.6-dev
66
homepage: https://github.com/GoogleCloudPlatform/functions-framework-dart
77

88
environment:
9-
sdk: '>=2.18.0 <3.0.0'
9+
sdk: ^3.0.0
1010

1111
executables:
1212
dartfn:
1313

1414
dependencies:
1515
args: ^2.1.1
1616
collection: ^1.15.0
17-
http: ^0.13.3
17+
http: '>=0.13.3 <2.0.0'
1818
io: ^1.0.0
1919
path: ^1.7.0
2020
usage: ^4.0.2
@@ -25,9 +25,9 @@ dev_dependencies:
2525
build_runner: ^2.0.4
2626
build_verify: ^3.0.0
2727
build_version: ^2.1.1
28+
dart_flutter_team_lints: ^1.0.0
2829
glob: ^2.0.0
2930
grinder: ^0.9.0
30-
lints: ^2.0.0
3131
source_gen: ^1.0.0
3232
test: ^1.15.7
3333
yaml: ^3.1.0

0 commit comments

Comments
 (0)