Improve pgindent exclude handling: ignore empty lines
Zsolt Parragi <zsolt.parragi@percona.com>
From: Zsolt Parragi <zsolt.parragi@percona.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-02-08T09:39:29Z
Lists: pgsql-hackers
Attachments
- 0001-Improve-pgindent-exclude-handling-ignore-empty-lines.patch (application/octet-stream) patch 0001
Hello, We ran into an issue where pgindent stopped reformatting anything with our custom exclude file, and after some investigation we found the empty line accidentally inserted into the exclude file. Pgindent currently treats empty lines as valid exclusions and creates an empty regex from them. The empty regex matches any pattern, resulting in ignoring everything. As this behavior doesn't seem to be useful in practice, and it is easy to reproduce accidentally (it works even at the end of the file), I propose a patch that ignores empty lines in the exclude file. If somebody really wants to ignore everything, that is still possible with more explicit patterns like ".*"
Commits
-
Ignore blank lines in pgindent exclude files
- 8e4d72573cc8 18.0 landed