-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
formattingIssue is related to `gren format`Issue is related to `gren format`
Description
#38 is a discussion of possible approaches. This issue tracks implementation progress for the current approach.
- add CLI subcommand with options and file processing Add format CLI subcommand #46
- format directories implied by
gren.json
Add format CLI subcommand #46 -
--yes
Add format CLI subcommand #46 -
--validate
Implement gren format --validate #143 - explicit
INPUTS...
Add format CLI subcommand #46 -
--stdin
Add format CLI subcommand #46
- format directories implied by
- modify parser/AST to retain comments and necessary whitespace info
- modify whitespace parser to parse comments Whitespace parser parses comments #56
- Formatting retains comments (module header and paren expressions) #132
- format: retain comments in import statements #142
- format: retain top-level comments #153
- format: retain comments in expression bodies (value decls, let, lambda) #154
- format: retain comments in
case
andif
expressions #159 - format: retain comments in arrays and records #160
- format: retain comments in remaining expressions #161
- format: retain comments in remaining types #162
- format: good things to fix before 0.2 #165
- TBD: retain comments part N
- retain comments in empty arrays and records
- implement the formatting logic
- initial implementation (everything no requiring whitespace info should work) Implement formatting logic (without comments/linebreak support) #117
- allow kernel module features when formatting kernel modules
- TBD any adjustments to formatting rules
- TBD fix anything that's broken
- add formatting test suite
- basic pattern established in Formatting retains comments (module header and paren expressions) #132
- (maybe) a property test to ensure that formatting is idempotent
- cleanup
- extract
Text.PrettyPrint.Avh4
to a separate library to share with elm-format
- extract
Planned CLI options:
gren format [INPUTS... | --stdin] [--yes] [--validate]
INPUTS
: zero or more files to format, or directories to recursively search for gren files to format. If none are given, use the directories implied bygren.json
--stdin
: instead of formatting files, read stdin and format it to stdout--yes
: don't prompt for confirmation before formatting files and overwriting them (does nothing with--stdin
)--validate
: Don't modify files, and exit 0 if files are all formatted, or exit 1 if some files are not formatted. Intended for use on CI.
Metadata
Metadata
Assignees
Labels
formattingIssue is related to `gren format`Issue is related to `gren format`