-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
implement requireSourceFieldsUsedExcept #608
Closed
nimatrueway
wants to merge
12
commits into
scalalandio:master
from
nimatrueway:248_sc3_RequireSourceFieldsExceptType
Closed
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
333f105
feat: add PathList to support vararg macros
nimatrueway 848908e
feat: add requireSourceFieldsExcept to DSL
nimatrueway 9c2d8f2
feat: add validations to Configurations
nimatrueway 123b923
feat: add usedSourceFields to DerivationResult state
nimatrueway 7be2c7a
impl: RequireAllSourceFieldsUsedExcept validation in product-to-produ…
nimatrueway 4720b2d
test: RequireAllSourceFieldsUsedExcept validation in product-to-produ…
nimatrueway 612e396
impl: RequireAllSourceFieldsUsedExcept for scala2
nimatrueway 13ebbaf
doc: add api-docs and website documentation
nimatrueway 6cddfa8
Revert "feat: add PathList to support vararg macros"
nimatrueway b611575
feat: change DSL to `.enableUnusedFieldPolicy(FailOnUnused)` flag and…
nimatrueway 633bcf7
feat: add API to TransformerDefinition
nimatrueway 8803e72
refactor: move source-field tracker to product-to-product rule
nimatrueway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,6 +249,17 @@ private[compiletime] trait ChimneyTypesPlatform extends ChimneyTypes { this: Chi | |
) | ||
} | ||
} | ||
object RequireSourceFieldsExcept extends RequireSourceFieldsExceptModule { | ||
def apply[ | ||
FromPathList <: runtime.PathList: Type, | ||
Tail <: runtime.TransformerOverrides: Type | ||
]: Type[runtime.TransformerOverrides.RequireSourceFieldsExcept[FromPathList, Tail]] = | ||
weakTypeTag[runtime.TransformerOverrides.RequireSourceFieldsExcept[FromPathList, Tail]] | ||
def unapply[A](A: Type[A]): Option[(?<[runtime.PathList], ?<[runtime.TransformerOverrides])] = | ||
A.asCtor[runtime.TransformerOverrides.RequireSourceFieldsExcept[?, ?]].map { A0 => | ||
(A0.param_<[runtime.PathList](0), A0.param_<[runtime.TransformerOverrides](1)) | ||
} | ||
} | ||
} | ||
|
||
object TransformerFlags extends TransformerFlagsModule { | ||
|
@@ -406,6 +417,17 @@ private[compiletime] trait ChimneyTypesPlatform extends ChimneyTypes { this: Chi | |
} | ||
} | ||
|
||
object PathList extends PathListModule { | ||
val Empty: Type[runtime.PathList.Empty] = weakTypeTag[runtime.PathList.Empty] | ||
object List extends ListModule { | ||
def apply[Head <: runtime.Path: Type, Tail <: runtime.PathList: Type]: Type[runtime.PathList.List[Head, Tail]] = | ||
weakTypeTag[runtime.PathList.List[Head, Tail]] | ||
def unapply[A](A: Type[A]): Option[(?<[runtime.Path], ?<[runtime.PathList])] = | ||
A.asCtor[runtime.PathList.List[?, ?]] | ||
.map(A0 => A0.param_<[runtime.Path](0) -> A0.param_<[runtime.PathList](1)) | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A list of paths would not be needed if instead this would apply a config, as many times as many paths there is in vararg. This would make less code to maintain in DSL and macros. |
||
|
||
object DefaultValue extends DefaultValueModule { | ||
def apply[Value: Type]: Type[integrations.DefaultValue[Value]] = | ||
weakTypeTag[integrations.DefaultValue[Value]] | ||
|
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.