Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:

jobs:
build:
uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.14
uses: Workiva/gha-dart-oss/.github/workflows/build.yaml@v0.1.15
with:
sdk: 3.7.2 # mirrors .tool-versions

checks:
uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.14
uses: Workiva/gha-dart-oss/.github/workflows/checks.yaml@v0.1.15
with:
sdk: 3.7.2 # mirrors .tool-versions

unit-tests:
uses: Workiva/gha-dart-oss/.github/workflows/test-unit.yaml@v0.1.14
uses: Workiva/gha-dart-oss/.github/workflows/test-unit.yaml@v0.1.15
with:
sdk: 3.7.2 # mirrors .tool-versions
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ permissions:

jobs:
publish:
uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.14
uses: Workiva/gha-dart-oss/.github/workflows/publish.yaml@v0.1.15
with:
sdk: stable
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
newest one the analyzer knows about, which may be unreleased and reject
valid code

- Allow up to analyzer 14

- Fix warning when `analyzer` is depended on but not used so that it is still
emitted when `analyzer` is in the `ignore` list.

# 5.0.6

- Allow up to analyzer 13
Expand Down
9 changes: 5 additions & 4 deletions lib/src/dependency_validator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,16 +315,17 @@ Future<bool> checkPackage({required String root}) async {
}

// Packages that are not used anywhere but are dependencies.
final unusedDependencies =
final rawUnusedDependencies =
// Start with all explicitly declared dependencies
deps
.union(devDeps)
// Remove all deps that were used in Dart code somewhere in this package
.difference(packagesUsedInPublicFiles)
.difference(packagesUsedOutsidePublicDirs)
// Remove this package, since we know they're using our executable
..remove(dependencyValidatorPackageName)
..removeAll(ignoredPackages);
..remove(dependencyValidatorPackageName);
final unusedDependencies = rawUnusedDependencies.toSet()
..removeAll(ignoredPackages);

final packageConfig = await findPackageConfig(Directory.current);
if (packageConfig == null) {
Expand Down Expand Up @@ -405,7 +406,7 @@ Future<bool> checkPackage({required String root}) async {
);
unusedDependencies.removeAll(packagesWithExecutables);

if (unusedDependencies.contains('analyzer')) {
if (rawUnusedDependencies.contains('analyzer')) {
logger.warning(
yellow.wrap(
'You do not need to depend on `analyzer` to run the Dart analyzer.\n'
Expand Down
14 changes: 7 additions & 7 deletions test/executable_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ void main() {
test('passes when dependencies not used provide executables', () async {
result = await checkProject(
devDependencies: {
"build_runner": hostedCompatibleWith('2.3.3'),
"build_runner": hostedAny,
'coverage': hostedAny,
'dart_style': hostedCompatibleWith('2.3.2'),
'dart_style': hostedAny,
},
project: [
d.dir('lib', [d.file('main.dart', 'book fake = true;')]),
Expand All @@ -353,9 +353,9 @@ void main() {
() async {
result = await checkProject(
dependencies: {
"build_runner": hostedCompatibleWith('2.3.3'),
"build_runner": hostedAny,
"coverage": hostedAny,
"dart_style": hostedCompatibleWith('2.3.2'),
"dart_style": hostedAny,
},
project: [
d.dir('lib', [d.file('main.dart', 'bool fake = true;')]),
Expand All @@ -377,9 +377,9 @@ void main() {
() async {
result = await checkProject(
devDependencies: {
'build_test': hostedCompatibleWith('2.0.1'),
'build_vm_compilers': hostedCompatibleWith('1.0.3'),
'build_web_compilers': hostedCompatibleWith('3.2.7'),
'build_test': hostedAny,
'json_serializable': hostedAny,
'build_web_compilers': hostedAny,
},
project: [
d.dir('lib', [d.file('main.dart', 'book fake = true;')]),
Expand Down
Loading