Skip to content

Support editorconfig - #3513

Merged
e-kwsm merged 1 commit into
koalaman:masterfrom
Freed-Wu:copilot/support-editorconfig-another-one
Sep 21, 2026
Merged

e-kwsm merged 1 commit into
koalaman:masterfrom
Freed-Wu:copilot/support-editorconfig-another-one

Conversation

@Freed-Wu

@Freed-Wu Freed-Wu commented Aug 5, 2026 •

Copy link
Copy Markdown

Fix #1843, Fix #2128, Fix #2118

EditorConfig cores shall accept and report all syntactically valid key-value pairs, even if the key is not defined in this specification.
EditorConfig plugins shall ignore unrecognized keys and invalid/unsupported values.

So we can use .editorconfig or global ~/.config/editorconfig.ini :

[{build,*.subpackage}.sh]
shellcheck.disable=SC2034

[{*.ebuild,*.eclass,*.conf,color.map,.devscripts,*.mdd}]
shellcheck.shell=bash
shellcheck.disable=SC2034

[{PKGBUILD,*.install}]
shellcheck.shell=bash
shellcheck.disable=SC2034,SC2154

[APKBUILD]
shellcheck.shell=sh
shellcheck.disable=SC2034,SC2154

[*/bash-completion/completions/*]
shellcheck.shell=bash

Refer termux-language-server for filenames.

Final result:

Screenshot_20260805_211713

PS: If someone want to realize #1844 #356 , can extend the config:

[{PKGBUILD,*.install}]
shellcheck.shell=bash
shellcheck.sourcefile=/the/path/of/PKGBUILD.d.sh

PKGBUILD.d.sh:

# avoid SC2154
export pkgdir srcdir
# avoid SC2034
export pkgver # ...

haskell doesn't have library for editorconfig. and ini doesn't support disabling inline comment as editorconfig. So we have to create one.

e-kwsm

This comment was marked as resolved.

@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 72371d8 to 3dcd562 Compare August 6, 2026 04:52
Comment thread shellcheck.hs Outdated
e-kwsm

This comment was marked as resolved.

@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 3dcd562 to 5da4a5f Compare August 7, 2026 11:49
e-kwsm

This comment was marked as resolved.

Comment thread src/ShellCheck/EditorConfig.hs
e-kwsm

This comment was marked as resolved.

Comment thread src/ShellCheck/EditorConfig.hs Outdated
@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 5da4a5f to 6ea5a2a Compare August 9, 2026 09:39
Comment thread src/ShellCheck/EditorConfig.hs Outdated
@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch 2 times, most recently from bf0cbc7 to 40d670a Compare August 10, 2026 13:53
Comment thread src/ShellCheck/EditorConfig.hs Outdated
Comment thread src/ShellCheck/EditorConfig.hs
@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 678f155 to 2b16090 Compare August 11, 2026 06:50
e-kwsm

This comment was marked as resolved.

@e-kwsm

This comment was marked as resolved.

e-kwsm

This comment was marked as resolved.

@Freed-Wu

This comment was marked as resolved.

@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch 3 times, most recently from e863124 to 51df507 Compare August 13, 2026 05:26
@Freed-Wu
Freed-Wu requested a review from e-kwsm August 20, 2026 21:16
e-kwsm

This comment was marked as duplicate.

Comment thread src/ShellCheck/EditorConfig.hs Outdated
e-kwsm

This comment was marked as resolved.

@Freed-Wu
Freed-Wu requested a review from e-kwsm August 24, 2026 11:33
e-kwsm

This comment was marked as resolved.

@e-kwsm
e-kwsm requested review from brother and koalaman August 26, 2026 00:22
@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 0d748c6 to deed6b3 Compare August 26, 2026 08:44
@brother
brother removed their request for review September 16, 2026 07:44
Fix EditorConfig section priority, glob depth matching, and root=true search stop
@Freed-Wu
Freed-Wu force-pushed the copilot/support-editorconfig-another-one branch from 6a86679 to 9aa7871 Compare September 17, 2026 17:31
@Freed-Wu
Freed-Wu requested a review from e-kwsm September 17, 2026 17:31
@Freed-Wu

Copy link
Copy Markdown
Author

it is interpreted in the same way as .shellcheckrc

So should we provide a different error message?

@e-kwsm

e-kwsm commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

So should we provide a different error message?

As of 9aa7871, shellcheck emits

In /tmp/.editorconfig line 4:
shellcheck.disable = SC2148 #abc
       ^-- SC1134 (error): Failed to process /tmp/.editorconfig, line 4: Expected '=' after directive key. Fix any mentioned problems and try again.

which is clear.

@e-kwsm
e-kwsm merged commit 5fe4d42 into koalaman:master Sep 21, 2026
16 checks passed
@e-kwsm

e-kwsm commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Thank you for your contribution!

@Freed-Wu
Freed-Wu deleted the copilot/support-editorconfig-another-one branch September 21, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants