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

Remove blank behaviour in different cases #156

Open
velios opened this issue Nov 10, 2024 · 3 comments
Open

Remove blank behaviour in different cases #156

velios opened this issue Nov 10, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@velios
Copy link

velios commented Nov 10, 2024

Hi, just watched your conj talk, this is cool - your efforts are appreciated.

Came across two different cases in different editors
Pic instead code block because it shows blankspaces.

In first case, which by default in my vscode setup
image
will be formatted to

(cond
  :cond-1
  :do-1
  :cond-2
  :do-2
  :cond-3
  :do-)

but(which default in my cursive setup)
image
will be formatted with respect to blank lines to

(cond
  :cond-1
  :do-1

  :cond-2
  :do-2

  :cond-3
  :do-)

I would personally prefer to respect empty lines, but I wonder which behavior is considered preferable and whether the formatter behaves correctly in both cases?

@oakmac
Copy link
Owner

oakmac commented Nov 11, 2024

Hi, just watched your conj talk, this is cool - your efforts are appreciated.

Thank you! 😁


I tested this as input and the formatter returned it unchanged (which is correct behavior):

(cond
  some-condition
  12

  another-condition
  13

  :else
  nil)

Can share the file exactly? What version of Standard Clojure Style are you using?

Another hunch: are you on Windows and does this file use CRLF line endings? The formatter should be able to handle that, but there was another bug that looked similar to this and I wonder if this is somehow related (Issue #102 and Issue #103).

@velios
Copy link
Author

velios commented Nov 11, 2024

Of course, my fault. Example https://github.com/velios/standart-clojure-style-issue
I'm on mac, compile my-standart-clj-binary to standalone binary like you show on video from 8a0588c19325033c63ead2e1acb40a606717dc6a

@oakmac
Copy link
Owner

oakmac commented Nov 11, 2024

Thank you sharing that!

Adding this here for my debugging efforts. I do see a difference between with_spaces.clj and without_spaces.clj when viewing with a hex editor.

Screenshot 2024-11-11 at 9 38 49 AM

@oakmac oakmac added bug Something isn't working help wanted Extra attention is needed labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants