-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add description field to package metadata #174
Conversation
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.
@earlbread Everything looks good to me except for some trivial style things. 👍🏼
test/Nirum/Targets/PythonSpec.hs
Outdated
@@ -37,7 +37,11 @@ import Nirum.Constructs.TypeExpression ( TypeExpression ( ListModifier | |||
) | |||
import Nirum.Package (Package (metadata, modules), resolveBoundModule) | |||
import Nirum.Package.Metadata ( Author (Author, email, name, uri) | |||
, Metadata (Metadata, authors, target, version) | |||
, Metadata (Metadata |
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.
A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.:
, Metadata ( Metadata
, authors
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.
Ok, I'll update it. Thank you!
test/Nirum/PackageSpec.hs
Outdated
@@ -35,7 +35,12 @@ import Nirum.Package ( BoundModule (boundPackage, modulePath) | |||
, scanPackage | |||
, types | |||
) | |||
import Nirum.Package.Metadata ( Metadata (Metadata, authors, target, version) | |||
import Nirum.Package.Metadata ( Metadata (Metadata |
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.
A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.:
, Metadata ( Metadata
, authors
src/Nirum/Targets/Python.hs
Outdated
@@ -1207,6 +1213,10 @@ setup( | |||
pName = packageName $ target metadata' | |||
pVersion :: Code | |||
pVersion = SV.toText $ version metadata' | |||
pDescription :: Code | |||
pDescription = case description metadata' of | |||
Just value -> T.intercalate "" ["'", value, "'"] |
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.
It can be broken if value
contains any apostrophe characters (i.e. single quotes).
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.
You're right! How about this change?
pDescription = case description metadata' of
Just value -> stringLiteral value
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.
It's why stringLiteral
function exists. Seems correct.
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.
So I'll fix like above. Thank you!
src/Nirum/Targets/Python.hs
Outdated
@@ -117,7 +117,12 @@ import Nirum.Package ( BoundModule | |||
, types | |||
) | |||
import Nirum.Package.Metadata ( Author (Author, name, email) | |||
, Metadata (Metadata, authors, target, version) | |||
, Metadata (Metadata |
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.
A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.:
, Metadata ( Metadata
, authors
src/Nirum/Package/Metadata.hs
Outdated
@@ -1,7 +1,12 @@ | |||
{-# LANGUAGE GADTs, QuasiQuotes, RankNTypes, ScopedTypeVariables, | |||
StandaloneDeriving, TypeFamilies #-} | |||
module Nirum.Package.Metadata ( Author (Author, email, name, uri) | |||
, Metadata (Metadata, authors, target, version) | |||
, Metadata (Metadata |
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.
A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.:
, Metadata ( Metadata
, authors
@dahlia I fixed things you mentioned. Thank you! |
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.
This patch adds the description field to package metadata. (#100)