1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-17 02:23:15 +03:00
postgres/.editorconfig
Peter Eisentraut 2452e71ff2 Add script to keep .editorconfig in sync with .gitattributes
Our repo already contained an .editorconfig file, but it was not kept
up to date with .gitattributes.  This adds a script that keeps these
files in sync.  A big advantage of the editorconfig file is that it
many editors/IDEs get automatically configured to trim trailing
newlines and add a final newline on save, while .gitattributes only
complains about these problems instead of automatically fixing them.

This also adds rules to .gitattributes for Python files as well as for
C files in pg_bsd_indent directory (which have a different tab_width
than most C files due to being vendored in).

Author: Jelte Fennema-Nio <github-tech@jeltef.nl>
Discussion: https://www.postgresql.org/message-id/flat/CAGECzQQGzbroAXi+Yicp3HvcCo4=g84kaOgjuvQ5MW9F0ubOGg@mail.gmail.com
2025-02-01 10:09:45 +01:00

177 lines
3.5 KiB
INI

root = true
[*]
indent_size = tab
[*]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = unset
tab_width = unset
[*.[chly]]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
tab_width = 4
[*.cpp]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
tab_width = 4
[*.pl]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
tab_width = 4
[*.pm]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
tab_width = 4
[*.po]
trim_trailing_whitespace = true
insert_final_newline = unset
indent_style = space
tab_width = unset
[*.py]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
tab_width = unset
indent_size = 4
[*.sgml]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
tab_width = unset
indent_size = 1
[*.xml]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
tab_width = unset
indent_size = 2
[*.xsl]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
tab_width = unset
indent_size = 1
[*.data]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[contrib/pgcrypto/sql/pgp-armor.sql]
trim_trailing_whitespace = unset
insert_final_newline = true
indent_style = unset
tab_width = unset
[src/backend/catalog/sql_features.txt]
trim_trailing_whitespace = unset
insert_final_newline = true
indent_style = unset
tab_width = unset
[*.out]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/interfaces/ecpg/test/expected/*]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[configure]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[ppport.h]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/backend/jit/llvm/SectionMemoryManager.cpp]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/backend/jit/llvm/SectionMemoryManager.LICENSE]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/backend/regex/COPYRIGHT]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/backend/snowball/libstemmer/*.c]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/backend/utils/mb/Unicode/*-std.txt]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/include/jit/SectionMemoryManager.h]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/include/snowball/libstemmer/*]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/timezone/data/*]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/tools/pg_bsd_indent/*]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/tools/pg_bsd_indent/tests/*]
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
[src/tools/pg_bsd_indent/*.[ch]]
trim_trailing_whitespace = unset
insert_final_newline = unset
indent_style = unset
tab_width = 8