Skip to content

Commit

Permalink
Add .editorconfig and .dir-locals.el
Browse files Browse the repository at this point in the history
This makes the formatting right in editors, and in github diff
view. The files are copied verbatim from PostgreSQL; we want the same
formatting.
  • Loading branch information
hlinnaka authored and bonnefoa committed Sep 17, 2024
1 parent bf7efa7 commit 96107f3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
;; Copied from PostgreSQL sources, for same formatting.

;; see also src/tools/editors/emacs.samples for more complete settings

((c-mode . ((c-basic-offset . 4)
(c-file-style . "bsd")
(fill-column . 78)
(indent-tabs-mode . t)
(tab-width . 4)))
(nxml-mode . ((fill-column . 78)
(indent-tabs-mode . nil)))
(perl-mode . ((perl-indent-level . 4)
(perl-continued-statement-offset . 2)
(perl-continued-brace-offset . -2)
(perl-brace-offset . 0)
(perl-brace-imaginary-offset . 0)
(perl-label-offset . -2)
(indent-tabs-mode . t)
(tab-width . 4)))
(sgml-mode . ((fill-column . 78)
(indent-tabs-mode . nil))))
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copied from PostgreSQL sources, for same formatting.

root = true

[*.{c,h,l,y,pl,pm}]
indent_style = tab
indent_size = tab
tab_width = 4

[*.{sgml,xml}]
indent_style = space
indent_size = 1

[*.xsl]
indent_style = space
indent_size = 2

0 comments on commit 96107f3

Please sign in to comment.