Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Flatten ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
gogolon committed Jul 30, 2024
1 parent 634c39b commit 736378a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/src/formatter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,13 @@ _PathFilter _getPathFilter({List<String>? reportOn, Set<Glob>? ignoreGlobs}) {
return (String path) {
final canonicalizedPath = p.canonicalize(path);

if (absolutePaths != null) {
if (!absolutePaths.any(canonicalizedPath.startsWith)) {
return false;
}
if (absolutePaths != null &&
!absolutePaths.any(canonicalizedPath.startsWith)) {
return false;
}
if (ignoreGlobs != null) {
if (ignoreGlobs.any((glob) => glob.matches(canonicalizedPath))) {
return false;
}
if (ignoreGlobs != null &&
ignoreGlobs.any((glob) => glob.matches(canonicalizedPath))) {
return false;
}

return true;
Expand Down

0 comments on commit 736378a

Please sign in to comment.