Skip to content

bug: shfmt ignores EditorConfig file #492

Description

@tigion

Neovim version (nvim -v)

0.10.0

Operating system/version

macOS 14.5

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

Describe the bug

Hi, the changes in #481 has the side effect, that in shfmt the EditorConfig file is ignored. Specifications such as switch_case_indent = true in the EditorConfig then no longer work.

Note

If any EditorConfig files are found, they will be used to apply formatting options. If any parser or printer flags are given to the tool, no EditorConfig formatting options will be used. A default like -i=0 can be used for this purpose.

from https://github.com/mvdan/sh/blob/68b762e/cmd/shfmt/shfmt.1.scd

I can add the -ci argument (stands for switch_case_indent = true), but I would be interested to know if ignoring the EditorConfig file is intentional.

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

Expected Behavior

Minimal example file

No response

Minimal init.lua

Additional context

No response

Activity

  1. stevearc commented on Jul 18, 2024

    @stevearc
    Owner

    Unintentional; I don't think anyone involved in that PR were aware that shfmt pulled values from .editorconfig when it was present. I've added an exemption for when a .editorconfig is present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions