editorconfig / editorconfig-emacs

EditorConfig plugin for Emacs
https://editorconfig.org
GNU General Public License v3.0
748 stars 107 forks source link

Fix parsing section lines with trailing comments #363

Open rdparker opened 5 days ago

rdparker commented 5 days ago

While working on zsa/qmk_firmware, I ran into the following error related to parsing the listed section header line:

editorconfig-error: Error thrown from editorconfig lib: "Error from editorconfig-get-properties-function: (editorconfig-error \"Error from editorconfig-get-properties-function: (error \\\"Error while reading config file: /home/.../qmk_firmware/.editorconfig:14:
    [{*.yaml,*.yml}] # To match GitHub Actions formatting
\\\")\")"

While having a trailing comment on a section header line is unusual, to my knowledge, it is not forbidden. This change patches the relevant regexp using the optional comment pattern from the cond clause immediately above it.