-
Notifications
You must be signed in to change notification settings - Fork 320
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
Typesafety for framework
and driver
flags
#89
Merged
Melkeydev
merged 17 commits into
Melkeydev:main
from
MitchellBerend:feature/type-safety
Nov 21, 2023
Merged
Typesafety for framework
and driver
flags
#89
Melkeydev
merged 17 commits into
Melkeydev:main
from
MitchellBerend:feature/type-safety
Nov 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MitchellBerend
force-pushed
the
feature/type-safety
branch
2 times, most recently
from
November 14, 2023 12:11
7c00e4b
to
d658fbf
Compare
Melkeydev
requested changes
Nov 14, 2023
cmd/flags/frameworks.go
Outdated
Comment on lines
26
to
31
// | ||
// type Value interface { | ||
// String() string | ||
// Set(string) error | ||
// Type() string | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh woops
MitchellBerend
force-pushed
the
feature/type-safety
branch
from
November 15, 2023 10:05
17ea684
to
e610a84
Compare
MitchellBerend
force-pushed
the
feature/type-safety
branch
from
November 17, 2023 06:50
e3f8e0b
to
0aec38c
Compare
MitchellBerend
force-pushed
the
feature/type-safety
branch
from
November 17, 2023 07:08
9c3eddf
to
9e5b081
Compare
MitchellBerend
changed the title
Typesafety for
Typesafety for Nov 18, 2023
framework
flagframework
and driver
flags
Melkeydev
requested changes
Nov 20, 2023
… valid throughout the codebase
MitchellBerend
force-pushed
the
feature/type-safety
branch
from
November 20, 2023 13:23
e443e0d
to
98faa2c
Compare
Melkeydev
approved these changes
Nov 21, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
SudoSurya
pushed a commit
to SudoSurya/go-blueprint
that referenced
this pull request
Nov 24, 2023
* Converted the framework flag to use a struct to ensure the content is valid throughout the codebase * Changed frameworks dir to flags * Added missing files * Updated comments * Removed stray comment * Updated Set function for Framework * Removed Contains check since it's not available yet * Fixed merge issues * Fixed more merge issues * Casting �options.ProjectType to flags.Framework * Fixed even more merge issues * Extended type safety to driver flag * Removed unused global var * Ran gofmt * Ran more gofmt * Replaced db hard coded strings with constants * Replaced strings with constants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
Problem/Feature
Currently the framework and driver flags is passed as a string that can contain any value. The value of this flag is then manually validated and compared to hard coded values.
Description of Changes:
Converted the framework driver flags to use a struct to ensure the content is valid throughout the code base. This creates a single place to add or change framework options. It also adds constants to compare values against.
This is a continuation of #61, this pr adds a type alias
Framework
that only allows for certain values to be passed as a flag.Checklist
- [ ] I have updated the documentation (if applicable)(Not applicable)