Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
rrousselGit committed Jul 18, 2024
1 parent cd32f72 commit 71d70f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/globe_cli/lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:args/args.dart';
import 'package:args/command_runner.dart';
import 'package:cli_completion/cli_completion.dart';
import 'package:get_it/get_it.dart';
import 'package:globe_cli/src/get_it.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:pub_updater/pub_updater.dart';

Expand All @@ -11,6 +10,7 @@ import 'commands/commands.dart';
import 'commands/create_project_command.dart';
import 'commands/project_command.dart';
import 'commands/update.dart';
import './get_it.dart';

Check notice on line 13 in packages/globe_cli/lib/src/command_runner.dart

View workflow job for this annotation

GitHub Actions / analyze

Sort directive sections alphabetically.

Try sorting the directives. See https://dart.dev/lints/directives_ordering to learn more about this problem.
import 'package_info.dart' as package_info;
import 'utils/api.dart';
import 'utils/auth.dart';
Expand Down
9 changes: 5 additions & 4 deletions packages/globe_cli/lib/src/utils/scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import 'dart:convert';
import 'dart:io';

import 'package:args/args.dart';
import 'package:globe_cli/src/utils/prompts.dart';
import 'package:mason_logger/mason_logger.dart';
import 'package:meta/meta.dart';
import 'package:path/path.dart' as p;

import '../exit.dart';
import 'api.dart';
import './prompts.dart';

Check notice on line 11 in packages/globe_cli/lib/src/utils/scope.dart

View workflow job for this annotation

GitHub Actions / analyze

Sort directive sections alphabetically.

Try sorting the directives. See https://dart.dev/lints/directives_ordering to learn more about this problem.
import 'metadata.dart';

/// A utility class for managing the user's local project.
Expand Down Expand Up @@ -64,7 +64,7 @@ class GlobeScope {
return organizations.firstWhere(
(org) => org.id == orgId,
orElse: () => throw Exception(
'Organization #${orgId} not found. '
'Organization #$orgId not found. '
'Either that organization does not exists or you do not have permission to access to it.',
),
);
Expand All @@ -76,14 +76,15 @@ class GlobeScope {
) async {
final projectId = argResults?['project'] ?? current?.projectId;

if (projectId is! String)
if (projectId is! String) {
return selectProject(org, logger: logger, api: api);
}

final projects = await api.getProjects(org: org.id);
return projects.firstWhere(
(project) => project.id == projectId,
orElse: () => throw Exception(
'Project #${projectId} not found. '
'Project #$projectId not found. '
'Either that project does not exists or you do not have permission to access to it.',
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'package:mason_logger/mason_logger.dart';
import 'package:mockito/mockito.dart';
import 'package:test/test.dart';

import '../../bin/globe.dart' as globe;
import '../mocks.dart';
import '../test_utils.dart';
import '../workspace.dart';
import '../../bin/globe.dart' as globe;

void main() {
setUp(() => GetIt.I.reset());
Expand All @@ -27,7 +27,7 @@ void main() {
slug: 'bar',
updatedAt: DateTime.now(),
type: OrganizationType.personal,
)
),
];
});
when(api.getProjects(org: 'bar')).thenAnswer((i) async {
Expand All @@ -39,7 +39,7 @@ void main() {
paused: false,
orgId: 'bar',
updatedAt: DateTime.now(),
)
),
];
});

Expand Down

0 comments on commit 71d70f4

Please sign in to comment.