Skip to content

empty-section

INI / EditorConfig / .gitignoresuspiciousno fixdefault: off

Reports a [section] header with no settings under it. Comments do not count as settings.

It usually is what is left when the last setting of a section was removed. A reader of the file wonders if the section matters, and some programs treat an empty section differently from a missing one.

To fix, delete the header, or add the setting.

Reported
[core]
bare = false
[empty]
[comment-only]
; nothing here
[user]
...
ini:
lint:
rules:
empty-section: warn # off (default), warn, error

Suppress one line with sudsy-disable-next-line empty-section in a comment of the file’s language.