-
Notifications
You must be signed in to change notification settings - Fork 696
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
code-generators field in test stanza. #7688
Changes from all commits
4f941ee
bc89056
c3e0eb9
d1b5f99
a9f54e1
1e5affd
085fd48
c167bfb
0141a2c
b21ff9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ import qualified Distribution.Types.BuildInfo.Lens as L | |
data TestSuite = TestSuite { | ||
testName :: UnqualComponentName, | ||
testInterface :: TestSuiteInterface, | ||
testBuildInfo :: BuildInfo | ||
testBuildInfo :: BuildInfo, | ||
testCodeGenerators :: [String] | ||
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 comment would be in order explaining this new field, maybe linking to this PR. In particular I wonder, should this field be non-revisable on Hackage? 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. our principle for allowing revisions has always been "by default, negative, and allow revision only if there's demonstrated need" 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. Thanks for the justification. |
||
} | ||
deriving (Generic, Show, Read, Eq, Typeable, Data) | ||
|
||
|
@@ -42,15 +43,17 @@ instance Monoid TestSuite where | |
mempty = TestSuite { | ||
testName = mempty, | ||
testInterface = mempty, | ||
testBuildInfo = mempty | ||
testBuildInfo = mempty, | ||
testCodeGenerators = mempty | ||
} | ||
mappend = (<>) | ||
|
||
instance Semigroup TestSuite where | ||
a <> b = TestSuite { | ||
testName = combine' testName, | ||
testInterface = combine testInterface, | ||
testBuildInfo = combine testBuildInfo | ||
testBuildInfo = combine testBuildInfo, | ||
testCodeGenerators = combine testCodeGenerators | ||
} | ||
where combine field = field a `mappend` field b | ||
combine' field = case ( unUnqualComponentName $ field a | ||
|
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.
String
isn't a good name for a type as it does not reflect its intended semantics. It is also badly searchable across the code base.and then use these type synonyms.
Extra points for a
newtype
!