Skip to content

Commit

Permalink
Bump analyzer dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed May 2, 2024
1 parent 16307ab commit fe5547c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 43 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.1
name: Dart CI
on:
push:
Expand Down Expand Up @@ -36,27 +36,27 @@ jobs:
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.5.7
run: dart pub global activate mono_repo 6.6.1
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyzer_and_format; Dart 3.0.0; PKGS: build_cli, build_cli_annotations; `dart analyze --fatal-infos .`"
name: "analyzer_and_format; Dart 3.3.0; PKGS: build_cli, build_cli_annotations; `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli-build_cli_annotations;commands:analyze"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli-build_cli_annotations;commands:analyze"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli-build_cli_annotations
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli-build_cli_annotations
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand All @@ -81,23 +81,23 @@ jobs:
needs:
- job_001
job_003:
name: "analyzer_and_format; Dart 3.0.0; PKGS: build_cli, build_cli_annotations; `dart format --output=none --set-exit-if-changed .`"
name: "analyzer_and_format; Dart 3.3.0; PKGS: build_cli, build_cli_annotations; `dart format --output=none --set-exit-if-changed .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli-build_cli_annotations;commands:format"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli-build_cli_annotations;commands:format"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli-build_cli_annotations
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli-build_cli_annotations
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down Expand Up @@ -204,23 +204,23 @@ jobs:
needs:
- job_001
job_006:
name: "unit_test; Dart 3.0.0; PKG: build_cli; `dart test --run-skipped --reporter expanded`"
name: "unit_test; Dart 3.3.0; PKG: build_cli; `dart test --run-skipped --reporter expanded`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli;commands:test"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli;commands:test"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0;packages:build_cli
os:ubuntu-latest;pub-cache-hosted;sdk:3.0.0
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:build_cli
os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: "3.0.0"
sdk: "3.3.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
Expand Down
5 changes: 5 additions & 0 deletions build_cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.2.4-wip

- Require latest `package:analyzer`.
- Require Dart `3.3`.

## 2.2.3

- Fix bug where nullable number options lead to an exception when parsing if
Expand Down
11 changes: 5 additions & 6 deletions build_cli/lib/src/arg_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ArgType _getArgType(FieldElement element, CliOption option) {

throwUnsupported(
element,
'`${targetType.getDisplayString(withNullability: false)}`'
'`${targetType.getDisplayString()}`'
' is not a supported type.',
);
}
Expand Down Expand Up @@ -172,8 +172,8 @@ CliOption? _getOptions(FieldElement element) {
// field's type is `BuildTool?` it's accessors will be the
// non-nullable type, `BuildTool`.
// TODO: find a better way to compare the underlying type
p.returnType.getDisplayString(withNullability: false) ==
element.type.getDisplayString(withNullability: false),
p.returnType.getDisplayString() ==
element.type.getDisplayString(),
)
.map((p) => p.name)
.toList();
Expand Down Expand Up @@ -308,13 +308,12 @@ CliOption? _getOptions(FieldElement element) {
}

if (!functionElement.returnType.isAssignableTo(element.type)) {
final typeString =
functionElement.returnType.getDisplayString(withNullability: false);
final typeString = functionElement.returnType.getDisplayString();
throwUnsupported(
element,
'The convert function `${functionElement.name}` return type '
'`$typeString` is not compatible with the field '
'type `${element.type.getDisplayString(withNullability: false)}`.',
'type `${element.type.getDisplayString()}`.',
);
}
_convertName[option] = ConverterData(
Expand Down
4 changes: 2 additions & 2 deletions build_cli/lib/src/build_cli_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ ${element.name} $resultParserName(ArgResults result) =>''',
assert(info.optionData!.provideDefaultToOverride);
String typeInfo;
if (converterDataFromOptions(info.optionData!) == null) {
typeInfo = info.dartType.getDisplayString(withNullability: false);
typeInfo = info.dartType.getDisplayString();
} else {
fyis.add(
'The value for [${_overrideParamName(fieldName)}] must be a '
'[String] that is convertible to '
'[${info.dartType.getDisplayString(withNullability: false)}].',
'[${info.dartType.getDisplayString()}].',
);
typeInfo = 'String';
}
Expand Down
4 changes: 2 additions & 2 deletions build_cli/lib/src/to_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Set<FieldElement> createSortedFieldSet(ClassElement element) {
continue;
}

if (v is PropertyAccessorElement && v.variable is FieldElement) {
fieldsList.add(v.variable as FieldElement);
if (v is PropertyAccessorElement && v.variable2 is FieldElement) {
fieldsList.add(v.variable2 as FieldElement);
}
}

Expand Down
6 changes: 3 additions & 3 deletions build_cli/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: build_cli
version: 2.2.3
version: 2.2.4-wip
description: >-
Parse command line arguments directly into an annotation class
using the power of build_runner and source_gen.
homepage: https://github.com/kevmoo/build_cli

environment:
sdk: ^3.0.0
sdk: ^3.3.0

dependencies:
analyzer: '>=5.12.0 <7.0.0'
analyzer: ^6.5.0
build: ^2.0.0
# Limit version range on build_cli_annotations
# new features need to stay in sync
Expand Down
2 changes: 1 addition & 1 deletion build_cli_annotations/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 2.1.1-wip

- Require `sdk: ^3.0.0`
- Require `sdk: ^3.3.0`

## 2.1.0

Expand Down
2 changes: 1 addition & 1 deletion build_cli_annotations/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: >-
homepage: https://github.com/kevmoo/build_cli

environment:
sdk: ^3.0.0
sdk: ^3.3.0

dependencies:
# Limit version range on args – it's exported
Expand Down
18 changes: 7 additions & 11 deletions tool/ci.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# Created with package:mono_repo v6.5.7
# Created with package:mono_repo v6.6.1

# Support built in commands on windows out of the box.

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter pub" is called instead of "dart pub".
# This assumes that the Flutter SDK has been installed in a previous step.
function pub() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand All @@ -12,18 +13,13 @@ function pub() {
command dart pub "$@"
fi
}
# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# This assumes that the Flutter SDK has been installed in a previous step.

function format() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
command flutter format "$@"
else
command dart format "$@"
fi
command dart format "$@"
}

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter analyze" is called instead of "dart analyze".
# This assumes that the Flutter SDK has been installed in a previous step.
function analyze() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand Down

0 comments on commit fe5547c

Please sign in to comment.