Skip to content

Commit 2493f97

Browse files
committed
Fix warning
1 parent 14d3899 commit 2493f97

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

packages/custom_lint/lib/src/workspace.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ class CustomLintWorkspace {
466466
);
467467

468468
return fromContextRoots(
469-
contextRootsWithCustomLint.whereNotNull().toList(),
469+
contextRootsWithCustomLint.nonNulls.toList(),
470470
workingDirectory: workingDirectory,
471471
);
472472
}
@@ -478,7 +478,7 @@ class CustomLintWorkspace {
478478
if (analyzerMap is! YamlMap) return null;
479479
return analyzerMap['plugins'];
480480
})
481-
.whereNotNull()
481+
.nonNulls
482482
.firstOrNull;
483483

484484
if (enabledPlugins is! YamlList) return false;
@@ -563,7 +563,7 @@ publish_to: 'none'
563563
return (project: project, constraint: constraint);
564564
})
565565
// TODO what if some projects specify SDK/Flutter but some don't?
566-
.whereNotNull()
566+
.nonNulls
567567
.toList();
568568

569569
final constraintCompatibleWithAllProjects = projectMeta.fold(
@@ -606,15 +606,15 @@ publish_to: 'none'
606606
if (dependency == null) return null;
607607
return (project: project, dependency: dependency);
608608
})
609-
.whereNotNull()
609+
.nonNulls
610610
.toList(),
611611
dependencyOverrides: projects
612612
.map((project) {
613613
final dependency = project.pubspec.dependencyOverrides[name];
614614
if (dependency == null) return null;
615615
return (project: project, dependency: dependency);
616616
})
617-
.whereNotNull()
617+
.nonNulls
618618
.toList(),
619619
),
620620
};
@@ -704,7 +704,7 @@ publish_to: 'none'
704704
if (dependency == null) return null;
705705
return (project: project, dependency: dependency);
706706
})
707-
.whereNotNull()
707+
.nonNulls
708708
.toList(),
709709
};
710710

@@ -1039,7 +1039,7 @@ class CustomLintProject {
10391039
);
10401040

10411041
return CustomLintProject._(
1042-
plugins: plugins.whereNotNull().toList(),
1042+
plugins: plugins.nonNulls.toList(),
10431043
directory: projectDirectory,
10441044
analysisDirectory: directory,
10451045
packageConfig: projectPackageConfig,

packages/custom_lint_builder/lib/src/client.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,7 @@ class _ClientAnalyzerPlugin extends analyzer_plugin.ServerPlugin {
583583
),
584584
]);
585585

586-
final analysisErrorFixesForOffset = allAnalysisErrorFixes
587-
.whereNotNull()
586+
final analysisErrorFixesForOffset = allAnalysisErrorFixes.nonNulls
588587
.where(
589588
(fix) =>
590589
parameters.offset >= fix.error.location.offset &&
@@ -599,8 +598,7 @@ class _ClientAnalyzerPlugin extends analyzer_plugin.ServerPlugin {
599598

600599
final errorCode = fix.error.code;
601600
fixAll.putIfAbsent(errorCode, () {
602-
final analysisErrorsWithCode = allAnalysisErrorFixes
603-
.whereNotNull()
601+
final analysisErrorsWithCode = allAnalysisErrorFixes.nonNulls
604602
.where((fix) => fix.error.code == errorCode)
605603
.toList();
606604

@@ -648,7 +646,7 @@ class _ClientAnalyzerPlugin extends analyzer_plugin.ServerPlugin {
648646

649647
return analyzer_plugin.EditGetFixesResult([
650648
...analysisErrorFixesForOffset,
651-
...fixAll.values.whereNotNull(),
649+
...fixAll.values.nonNulls,
652650
]);
653651
}
654652

packages/custom_lint_builder/lib/src/ignore.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ final _ignoreForFileRegex =
9191

9292
/// Searches for `// ignore_for_file:` in a given file.
9393
List<IgnoreMetadata> parseIgnoreForFile(String source) {
94-
final ignoreForFiles = _ignoreForFileRegex.allMatches(source).whereNotNull();
94+
final ignoreForFiles = _ignoreForFileRegex.allMatches(source).nonNulls;
9595

9696
return ignoreForFiles
9797
.map((e) => IgnoreMetadata._parse(e, startOffset: 0))

0 commit comments

Comments
 (0)