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

indent_style = space in .editorconfig is not respected by shfmt #1090

Open
Karmenzind opened this issue Aug 28, 2024 · 2 comments
Open

indent_style = space in .editorconfig is not respected by shfmt #1090

Karmenzind opened this issue Aug 28, 2024 · 2 comments

Comments

@Karmenzind
Copy link

The file is:

#!/usr/bin/env bash

if [[ true ]]; then
    echo 1  # leading with 4 spaces
fi

And shfmt will change the leading spaces to tab:
image

My ~/.editorconfig:

root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line          = lf
insert_final_newline = true
indent_style         = space
indent_size          = 4

[*.sh]
indent_size        = 4
indent_style       = space
shell_variant      = bash
binary_next_line   = false

switch_case_indent = true
space_redirects    = true
keep_padding       = true

function_next_line = false
@mvdan
Copy link
Owner

mvdan commented Sep 15, 2024

What shfmt version are you running? Did you double check this? Because we have code and tests for this feature, so this seems odd.

@Karmenzind
Copy link
Author

Karmenzind commented Sep 16, 2024

Sorry for the missing information. I'm using the latest version 3.9.0:

added cat -T to visualize the tabs

image

OS ENV:

> uname -a                                                                                                                                                                                                                   
Linux ringo 6.10.8-arch1-2.1-g14 #1 SMP PREEMPT_DYNAMIC Sat, 07 Sep 2024 06:01:43 +0000 x86_64 GNU/Linux

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