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

JuliaFormatter Incorrectly deleting indents? #773

Open
dom-linkevicius opened this issue Oct 20, 2023 · 2 comments
Open

JuliaFormatter Incorrectly deleting indents? #773

dom-linkevicius opened this issue Oct 20, 2023 · 2 comments

Comments

@dom-linkevicius
Copy link

Hi,

I'm using JuliaFormatter [98e50ef6] on Windows via VSCode, but have been constantly running into issues where it is seemingly deleting indents where it shouldn't, e.g. if I have test.jl with simply

[TAB][TAB][TAB][TAB][TAB]"a"

and then run format("test.jl") this turns into

"a"

which seems like a bug. JuliaFormatter.toml has only indent = 2. Any help or clarifications greatly appreciated, if any extra info needed please let me know.

@domluna
Copy link
Owner

domluna commented Oct 20, 2023

if you have a file like this

                                             "a"

to will align the "a" to the indent level which if there are no block scopes would be the lefthand side of the file

"a"

@dom-linkevicius
Copy link
Author

dom-linkevicius commented Oct 23, 2023

Sorry, my fault, I gave an incorrect example, it's more like the following:

 this_is_some_random_code_expression_that_includes_a_long_string_over_multiple_lines == """
 [TAB][TAB][TAB][TAB][TAB][TAB][TAB]this is the first part of some long string that is split over multiple lines
 [TAB][TAB][TAB][TAB][TAB][TAB][TAB]this is the second part of some long string that is split over multiple lines"""

turning to

this_is_some_random_code_expression_that_includes_a_long_string_over_multiple_lines == """
this is the first part of some long string that is split over multiple lines
this is the second part of some long string that is split over multiple lines"""

On other machines JuliaFormatter does not seem to remove the tabs and GitHub JuliaFormatter expects the tabs to be there and CI throws due to incorrect formatting. But on my machine JuliaFormatter removes the tabs added by a JuliaFormatter on a different machine.

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