Skip to content
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

Policy for the superficial layout (spacing, newlines, ...). #11

Open
herbelin opened this issue Sep 28, 2018 · 5 comments
Open

Policy for the superficial layout (spacing, newlines, ...). #11

herbelin opened this issue Sep 28, 2018 · 5 comments

Comments

@herbelin
Copy link
Contributor

I would like to mention an approach which has been useful in uniformizing the layout of files of the standard library and giving a feeling of homogeneity of style, which is the use of a standardized pretty-printer (aka "beautifier").

@gmalecha
Copy link

Are there any existing code formatters for Coq?

@Zimmi48
Copy link
Contributor

Zimmi48 commented Sep 28, 2018

@gmalecha The beautifier is one but in its current state it produces quite horrible output. However, we could consider working on it again to make it a good formatter. It would typically be the kind of thing that should be available in a Coq language server (cc @ejgallego). Code formatters are a very trendy approach these days (gofmt, elm-format, etc.) to making sure that discussions on formatting do not interfere with other works and to "reducing cognitive load".

@ejgallego
Copy link

ejgallego commented Sep 28, 2018

You can indeed use SerAPI to print a whole file in a slightly more controlled way, however this uses the same printer than the "beautifier", so you won't get terribly different output even if you could perform some additional tweaks thanks the to extra control.

Of course, you can parse the JSON/SEXP representation of the AST in any other language and print as you'd like.

@spitters
Copy link

spitters commented Sep 28, 2018 via email

@ejgallego
Copy link

@spitters thanks for the link, you could implement that kind of script today in a robust way using SerAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants