pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedAdd .editorconfig
6+ messages / 3 participants
[nested] [flat]
* Add .editorconfig
@ 2019-12-11 16:00 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
0 siblings, 3 replies; 6+ messages in thread
From: Peter Eisentraut @ 2019-12-11 16:00 UTC (permalink / raw)
To: pgsql-hackers
There were a couple of recent threads that wanted to add an
.editorconfig file but never actually ended up doing so.[0][1] Here is
a patch. It is meant to match more or less what's in .dir-locals.el.
I have only tested this with the GitHub view, not with an actual editor.
[0]:
https://www.postgresql.org/message-id/flat/20180605172252.GA2433%40fetter.org
[1]:
https://www.postgresql.org/message-id/flat/20180529153617.c72llpzbvt46chr6%40alap3.anarazel.de
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From fcf66f8a2e29818b55b0f2c4754bd8bef15bc546 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 11 Dec 2019 16:53:48 +0100
Subject: [PATCH] Add .editorconfig
---
.editorconfig | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..d69a3d1dc4
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+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
--
2.24.0
Attachments:
[text/plain] 0001-Add-.editorconfig.patch (652B, ../../273cb788-bbb2-ff34-ad6f-5192b44e5049@2ndquadrant.com/2-0001-Add-.editorconfig.patch)
download | inline diff:
From fcf66f8a2e29818b55b0f2c4754bd8bef15bc546 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Wed, 11 Dec 2019 16:53:48 +0100
Subject: [PATCH] Add .editorconfig
---
.editorconfig | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 .editorconfig
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..d69a3d1dc4
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+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
--
2.24.0
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Add .editorconfig
@ 2019-12-11 16:09 Daniel Gustafsson <daniel@yesql.se>
parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Gustafsson @ 2019-12-11 16:09 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; +Cc: pgsql-hackers
> On 11 Dec 2019, at 17:00, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>
> There were a couple of recent threads that wanted to add an .editorconfig file but never actually ended up doing so.[0][1] Here is a patch. It is meant to match more or less what's in .dir-locals.el.
+[*.{c,h,l,y,pl,pm}]
What about *.sh?
Not that there is much of Python in the tree, but shouldn't those also be
covered if we do this?
[*.py]
indent_style = space
indent_size = 4
cheers ./daniel
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Add .editorconfig
@ 2019-12-11 16:28 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Daniel Gustafsson <daniel@yesql.se>
0 siblings, 0 replies; 6+ messages in thread
From: Peter Eisentraut @ 2019-12-11 16:28 UTC (permalink / raw)
To: Daniel Gustafsson <daniel@yesql.se>; +Cc: pgsql-hackers
On 2019-12-11 17:09, Daniel Gustafsson wrote:
>> On 11 Dec 2019, at 17:00, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>>
>> There were a couple of recent threads that wanted to add an .editorconfig file but never actually ended up doing so.[0][1] Here is a patch. It is meant to match more or less what's in .dir-locals.el.
>
> +[*.{c,h,l,y,pl,pm}]
>
> What about *.sh?
>
> Not that there is much of Python in the tree, but shouldn't those also be
> covered if we do this?
>
> [*.py]
> indent_style = space
> indent_size = 4
Those were not in the Emacs config either.
I'd be inclined to leave the Python stuff alone, in particular. The
PEP-8 style appears to be universally accepted as the default, so we
don't need to specify it here. We only need to specify what's different
or where no sensible default exists.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Add .editorconfig
@ 2019-12-11 17:54 Andreas Karlsson <andreas@proxel.se>
parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2 siblings, 1 reply; 6+ messages in thread
From: Andreas Karlsson @ 2019-12-11 17:54 UTC (permalink / raw)
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>; pgsql-hackers
I have not used .editorconfig that much, but would it makes sense to add
the below?
[*]
end_of_line = lf
--
Andreas Karlsson
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Add .editorconfig
@ 2019-12-12 08:33 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Andreas Karlsson <andreas@proxel.se>
0 siblings, 0 replies; 6+ messages in thread
From: Peter Eisentraut @ 2019-12-12 08:33 UTC (permalink / raw)
To: Andreas Karlsson <andreas@proxel.se>; pgsql-hackers
On 2019-12-11 18:54, Andreas Karlsson wrote:
> I have not used .editorconfig that much, but would it makes sense to add
> the below?
>
> [*]
> end_of_line = lf
I think that would best be done in response to an actual need.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Add .editorconfig
@ 2019-12-18 08:14 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2 siblings, 0 replies; 6+ messages in thread
From: Peter Eisentraut @ 2019-12-18 08:14 UTC (permalink / raw)
To: pgsql-hackers
On 2019-12-11 17:00, Peter Eisentraut wrote:
> There were a couple of recent threads that wanted to add an
> .editorconfig file but never actually ended up doing so.[0][1] Here is
> a patch. It is meant to match more or less what's in .dir-locals.el.
committed
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-12-18 08:14 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 16:00 Add .editorconfig Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-12-11 16:09 ` Daniel Gustafsson <daniel@yesql.se>
2019-12-11 16:28 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-12-11 17:54 ` Andreas Karlsson <andreas@proxel.se>
2019-12-12 08:33 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
2019-12-18 08:14 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox