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

Ignore a block of code #113

Open
benjamin-thomas opened this issue Aug 7, 2023 · 2 comments
Open

Ignore a block of code #113

benjamin-thomas opened this issue Aug 7, 2023 · 2 comments

Comments

@benjamin-thomas
Copy link

Hello. Thanks for this formatter.

I'm following the PureScript book and we are given this function on chapter 3:

showAddress :: Address -> String
showAddress addr = addr.street <> ", " <>
                   addr.city <> ", " <>
                   addr.state

However purs-tidy reformats it like this:

showAddress :: Address -> String
showAddress addr = addr.street <> ", "
  <> addr.city
  <> ", "
  <>
    addr.state

Which looks much less readable. But it seems to do a pretty good job at formatting most times.

Is it possible to ignore a block of code via a magic comment? Or maybe ignore a whole file via a custom config?

It doesn't seem to be so after quickly skimming through the code but I thought I'd ask anyways :)

Thanks

@natefaubion
Copy link
Owner

There is no option to do this.

For the operator issue, see #106 (comment)

@benjamin-thomas
Copy link
Author

Oh I see. I didn't expect this "dangling line" to be overridable.

It looks like I can dictate where my new lines go, so the formatter is fine keeping this "shape", which is much better.

showAddress :: Address -> String
showAddress addr =
  addr.street
    <> ", "
    <> addr.city
    <> ", "
    <> addr.state

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

2 participants