Skip to content

Commit

Permalink
refactor: fix analyzer issues (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Oct 16, 2023
1 parent b049ed8 commit 2f19770
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions packages/melos/lib/src/commands/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mixin _BootstrapMixin on _CleanMixin {
workspace: workspace,
),
'get',
if (workspace.config.commands.bootstrap.runPubGetOffline) '--offline'
if (workspace.config.commands.bootstrap.runPubGetOffline) '--offline',
].join(' ');

logger
Expand Down Expand Up @@ -163,7 +163,7 @@ mixin _BootstrapMixin on _CleanMixin {
workspace: workspace,
),
'get',
if (workspace.config.commands.bootstrap.runPubGetOffline) '--offline'
if (workspace.config.commands.bootstrap.runPubGetOffline) '--offline',
];

final process = await startCommandRaw(
Expand Down
4 changes: 2 additions & 2 deletions packages/melos/lib/src/commands/list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ mixin _ListMixin on _Melos {
package.name,
AnsiStyles.green((package.version).toString()),
AnsiStyles.gray(printablePath(package.pathRelativeToWorkspace)),
if (package.isPrivate) AnsiStyles.red('PRIVATE')
if (package.isPrivate) AnsiStyles.red('PRIVATE'),
],
)
.cast<List<String>>()
Expand Down Expand Up @@ -132,7 +132,7 @@ mixin _ListMixin on _Melos {
'version': package.version.toString(),
'private': package.isPrivate,
'location': packagePath,
'type': package.type.index
'type': package.type.index,
};

if (long) {
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/lib/src/commands/publish.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ mixin _PublishMixin on _ExecMixin {
AnsiStyles.dim(latestPublishedVersionForPackages[package.name]),
AnsiStyles.green(package.version.toString()),
];
})
}),
],
paddingSize: 4,
),
Expand Down
6 changes: 3 additions & 3 deletions packages/melos/lib/src/commands/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mixin _VersionMixin on _RunMixin {
for (final package in workspace.filteredPackages.values)
if (!packagesToManuallyVersion.contains(package))
if (packagesWithVersionableCommits.contains(package.name))
if (!asStableRelease || !package.version.isPreRelease) package
if (!asStableRelease || !package.version.isPreRelease) package,
};
final packagesToVersion = {
...packagesToManuallyVersion,
Expand Down Expand Up @@ -662,7 +662,7 @@ mixin _VersionMixin on _RunMixin {
if (updateDependentsConstraints) {
await Future.forEach([
...pendingPackageUpdate.package.dependentsInWorkspace.values,
...pendingPackageUpdate.package.devDependentsInWorkspace.values
...pendingPackageUpdate.package.devDependentsInWorkspace.values,
], (package) {
return _setDependencyVersionForDependentPackage(
package,
Expand Down Expand Up @@ -710,7 +710,7 @@ mixin _VersionMixin on _RunMixin {
final dateSlug = [
today.year.toString(),
today.month.toString().padLeft(2, '0'),
today.day.toString().padLeft(2, '0')
today.day.toString().padLeft(2, '0'),
].join('-');

final packages =
Expand Down
4 changes: 2 additions & 2 deletions packages/melos/lib/src/common/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,10 @@ bool isPubSubcommand({required MelosWorkspace workspace}) {
void sortPackagesForPublishing(List<Package> packages) {
final packageNames = packages.map((package) => package.name).toList();
final graph = <String, Iterable<String>>{
for (var package in packages)
for (final package in packages)
package.name: [
...package.dependencies.where(packageNames.contains),
...package.devDependencies.where(packageNames.contains)
...package.devDependencies.where(packageNames.contains),
],
};
final ordered =
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ class PackageMap {
ignore: [
...ignore,
for (final pattern in _commonIgnorePatterns)
createGlob(pattern, currentDirectoryPath: workspacePath)
createGlob(pattern, currentDirectoryPath: workspacePath),
],
);

Expand Down
2 changes: 1 addition & 1 deletion packages/melos/test/commands/bootstrap_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Generating IntelliJ IDE files...
mergeMelosPubspecOverrides(
{
for (final entry in melosDependencyOverrides.entries)
entry.key: PathReference(entry.value)
entry.key: PathReference(entry.value),
},
currentPubspecOverrides,
),
Expand Down
4 changes: 2 additions & 2 deletions packages/melos/test/commands/clean_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void main() {
pubspecOverrides,
yamlFile({
'dependency_overrides': {
'a': {'path': relativePath(packageADir.path, packageBDir.path)}
}
'a': {'path': relativePath(packageADir.path, packageBDir.path)},
},
}),
);

Expand Down
6 changes: 3 additions & 3 deletions packages/melos/test/commands/run_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
packageFilters: PackageFilters(
fileExists: const ['log.txt'],
),
)
),
}),
),
);
Expand Down Expand Up @@ -155,7 +155,7 @@ melos run hello
name: 'hello',
run: 'echo',
exec: ExecOptions(),
)
),
}),
),
);
Expand Down Expand Up @@ -225,7 +225,7 @@ melos run hello
exec: ExecOptions(
concurrency: 1,
),
)
),
}),
),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/test/package_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void main() {
MockPackageFs(
name: 'melos',
version: Version(0, 0, 0),
)
),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/melos/test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Future<Directory> createProject(
else ...[
'packages',
pubSpec.name!,
]
],
]),
);

Expand Down
18 changes: 9 additions & 9 deletions packages/melos/test/workspace_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void main() {
runPubGetInParallel: false,
runPubGetOffline: true,
dependencyOverridePaths: [
createGlob('a', currentDirectoryPath: '.')
createGlob('a', currentDirectoryPath: '.'),
],
),
);
Expand Down Expand Up @@ -155,7 +155,7 @@ void main() {
'packageFilters': {'flutter': true},
'description': 'Changelog for all foo packages.',
}
]
],
},
workspacePath: '.',
),
Expand Down Expand Up @@ -215,7 +215,7 @@ void main() {
const {
'bootstrap': {
'runPubGetInParallel': true,
}
},
},
workspacePath: '.',
),
Expand All @@ -236,7 +236,7 @@ void main() {
const {
'bootstrap': {
'runPubGetOffline': true,
}
},
},
workspacePath: '.',
),
Expand All @@ -256,7 +256,7 @@ void main() {
'message': 'Hello world',
'branch': 'main',
'linkToCommits': true,
}
},
},
workspacePath: '.',
),
Expand Down Expand Up @@ -429,7 +429,7 @@ void main() {
'exec': {
'concurrency': 1,
'failFast': true,
'orderDependents': true
'orderDependents': true,
},
},
}),
Expand Down Expand Up @@ -520,7 +520,7 @@ void main() {
expect(
() => MelosWorkspaceConfig.fromYaml(
createYamlMap({
'packages': <Object?>['*']
'packages': <Object?>['*'],
}),
path: testWorkspacePath,
),
Expand Down Expand Up @@ -617,7 +617,7 @@ void main() {
() => MelosWorkspaceConfig.fromYaml(
createYamlMap(
{
'packages': [42]
'packages': [42],
},
defaults: configMapDefaults,
),
Expand Down Expand Up @@ -658,7 +658,7 @@ void main() {
() => MelosWorkspaceConfig.fromYaml(
createYamlMap(
{
'ignore': [42]
'ignore': [42],
},
defaults: configMapDefaults,
),
Expand Down
6 changes: 3 additions & 3 deletions packages/melos/test/workspace_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The packages that caused the problem are:
configBuilder: (path) => MelosWorkspaceConfig.fromYaml(
const {
'name': 'test',
'packages': ['.']
'packages': ['.'],
},
path: path,
),
Expand All @@ -185,7 +185,7 @@ The packages that caused the problem are:
configBuilder: (path) => MelosWorkspaceConfig.fromYaml(
const {
'name': 'test',
'packages': ['packages/a']
'packages': ['packages/a'],
},
path: path,
),
Expand Down Expand Up @@ -246,7 +246,7 @@ The packages that caused the problem are:
config,
packageFilters: PackageFilters(
scope: [
createGlob('b', currentDirectoryPath: workspaceDir.path)
createGlob('b', currentDirectoryPath: workspaceDir.path),
],
includeDependencies: true,
),
Expand Down

0 comments on commit 2f19770

Please sign in to comment.