Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(shorebird_cli): consolidate command precondition checks in ShorebirdValidationMixin #575

Merged
merged 6 commits into from
Jun 1, 2023

Conversation

bryanoltman
Copy link
Contributor

Description

Moves repeated validator, isUserAuthenticated, and isShorebirdInitialized logic into the ShorebirdValidationMixin.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

import 'package:shorebird_cli/src/validators/validators.dart';

mixin ShorebirdValidationMixin on ShorebirdCommand {
abstract interface class PreconditionFailedException implements Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice use of interface 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Playing with the new toys! 😄

Base automatically changed from bo/patch-android to main June 1, 2023 16:20
# Conflicts:
#	packages/shorebird_cli/lib/src/commands/patch/patch_android_command.dart
#	packages/shorebird_cli/lib/src/commands/patch/patch_command.dart
@bryanoltman bryanoltman merged commit 3c07866 into main Jun 1, 2023
@bryanoltman bryanoltman deleted the bo/preconditions-validation branch June 1, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants