-
Notifications
You must be signed in to change notification settings - Fork 23
Use Vary for key output format
#1146
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
Conversation
056cbe2 to
2e538ba
Compare
|
Addresses: #566 |
| import Data.Text.IO qualified as Text | ||
|
|
||
| import Vary (Vary) | ||
| import Vary qualified |
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.
Could you add grouping of this import with other hackage packages in fourmolu.yaml? A standalone import group looks odd.
Btw. I think author should've chosen more conventional module name like Data.Vary or something.
| keyOutputFormat | ||
| & ( id | ||
| . Vary.on | ||
| ( \FormatBech32 -> |
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.
I'm wondering if in the next step we could refactor out duplicated rendering of each of the formats
| , Opt.help $ | ||
| mconcat | ||
| [ "Optional key output format. Accepted output formats are \"text-envelope\" " | ||
| , "and \"bech32\" (deprecated)." |
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.
Why bech32 is deprecated?
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.
bech32 isn't deprecated. The --key-output-format switch is.
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.
Ah, the phrasing was slightly confusing. Maybe it should say "deprecated flag" or something.
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.
Fixed up the message to be more clear.
Jimbo4350
left a comment
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 👍
| alternatives fs <|> defaults fs | ||
| parserFromFlags :: Parser a -> (Flag a -> String) -> [Flag a] -> Parser a | ||
| parserFromFlags p mkHelp fs = | ||
| alternatives fs <|> p <|> defaults fs |
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.
p appears to be an actual parser (not empty) in pKeyOutputFormat. We should deprecate pKeyOutputFormat and remove p in the future.
Edit: I see you've already done that 👍
138be17 to
802dbf3
Compare
802dbf3 to
5a513b7
Compare
carbolymer
left a comment
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. Could you update changelog entry with the information about the flag changes?
… the supplied flags and the default
067e362 to
267e2ca
Compare
0076698 to
d239164
Compare
Changelog
Context
Progression towards input-output-hk/cardano-node-wiki#72
How to trust this PR
Highlight important bits of the PR that will make the review faster. If there are commands the reviewer can run to observe the new behavior, describe them.
Checklist