From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>
Cc: git@vger.kernel.org, Taylor Blau <me@ttaylorr.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 1/2] editorconfig: provide editor settings for Git developers
Date: Mon, 08 Oct 2018 22:53:52 +0200 [thread overview]
Message-ID: <87sh1gcg7z.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20181008202903.100166-2-sandals@crustytoothpaste.net>
On Mon, Oct 08 2018, brian m. carlson wrote:
> Contributors to Git use a variety of editors, each with their own
> configuration files. Because C lacks the defined norms on how to indent
> and style code that other languages, such as Ruby and Rust, have, it's
> possible for various contributors, especially new ones, to have
> configured their editor to use a style other than the style the Git
> community prefers.
>
> To make automatically configuring one's editor easier, provide an
> EditorConfig file. This is an INI-style configuration file that can be
> used to specify editor settings and can be understood by a wide variety
> of editors. Some editors include this support natively; others require
> a plugin. Regardless, providing such a file allows users to
> automatically configure their editor of choice with the correct settings
> by default.
>
> Provide global settings to set the character set to UTF-8 and insert a
> final newline into files. Provide language-specific settings for C,
> Shell, Perl, and Python files according to what CodingGuidelines already
> specifies. Since the indentation of other files varies, especially
> certain AsciiDoc files, don't provide any settings for them until a
> clear consensus forward emerges.
>
> Set the line length for commit messages to 72 characters, which is the
> generally accepted line length for emails, since we send patches by
> email.
>
> Don't specify an end of line type. While the Git community uses
> Unix-style line endings in the repository, some Windows users may use
> Git's auto-conversion support and forcing Unix-style line endings might
> cause problems for those users.
>
> Finally, leave out a root directive, which would prevent reading other
> EditorConfig files higher up in the tree, in case someone wants to set
> the end of line type for their system in such a file.
>
> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
> ---
> .editorconfig | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> create mode 100644 .editorconfig
>
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 0000000000..83227fa0b2
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,14 @@
> +[*]
> +charset = utf-8
> +insert_final_newline = true
> +
> +[*.{c,h,sh,perl}]
> +indent_style = tab
> +tab_width = 8
It looks like we can add at least "pm" and "pl" to that pattern:
$ git ls-files|grep -E -v -e '\.(c|h|sh|perl)$' | grep -F .| sed 's/.*\.//'|sort|uniq -c|sort -nr|head -n 15
631 txt
56 expect
48 po
41 test
40 tcl
34 gitignore
24 pm
18 patch
18 diff
16 pl
15 side
14 gitattributes
12 dump
11 sample
9 master
> +[*.py]
> +indent_style = space
> +indent_size = 4
> +
> +[COMMIT_EDITMSG]
> +max_line_length = 72
next prev parent reply other threads:[~2018-10-08 20:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-08 20:29 [PATCH v2 0/2] EditorConfig file brian m. carlson
2018-10-08 20:29 ` [PATCH v2 1/2] editorconfig: provide editor settings for Git developers brian m. carlson
2018-10-08 20:53 ` Ævar Arnfjörð Bjarmason [this message]
2018-10-08 21:54 ` brian m. carlson
2018-10-08 20:29 ` [PATCH v2 2/2] editorconfig: indicate settings should be kept in sync brian m. carlson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sh1gcg7z.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=sandals@crustytoothpaste.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.