git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add an EditorConfig file

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Sep 20, 2018, 00:00 UTC
Message-ID
<20180920000013.GZ432229@genre.crustytoothpaste.net>
In-Reply-To
<xmqqtvmm42es.fsf@gitster-ct.c.googlers.com>
On Tue, Sep 18, 2018 at 08:00:27PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes:
> 
> > 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.
> 
> Good intentions.  One thing that makes me wonder is how well this
> plays with "make style" and how easy will it be to keep their
> recommendations in sync.  Ideally, if we can generate one from the
> other, or both from a unified source, that would be great.

I think "make style" and the EditorConfig file are complementary. "make style" autoformats code into a diff. I agree that if we always used clang-format to format code, then this would be a non-issue in the EditorConfig file, since we'd just tell people to format their code and be done with it. However, we don't automatically do that, so I think this still has value.

(I am having trouble getting make style to work, though, because it seems to invoke clang-format as a git subcommand, and I don't think that works. I may send a patch.)

Even if we did that, we couldn't do it for Perl, because the tidy tool for Perl, perltidy, produces different output depending on version. I expect we'll have little success in trying to standardize on a given version.

The EditorConfig file applies to a variety of formats and is designed to set default editor settings (which users *can* override if they choose). It applies to any file pattern; for example, as Taylor pointed out, we could use it to recommend 72-character lines in commit messages.

I agree that maintaining more files is a hassle, but personally, I think it quite unlikely that we're going to change the Git style, so I feel the maintenance is fairly low.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 12 in “Add an EditorConfig file”
  1. Add an EditorConfig filebrian m. carlson, Sep 17, 2018
  2. Taylor BlauSep 17, 2018
  3. brian m. carlsonSep 20, 2018
  4. Junio C HamanoSep 19, 2018
  5. brian m. carlsonSep 20, 2018
  6. Junio C HamanoSep 20, 2018
  7. brian m. carlsonSep 21, 2018
  8. Junio C HamanoSep 24, 2018
  9. brian m. carlsonSep 27, 2018
  10. Eric SunshineSep 21, 2018
  11. Jeff KingSep 21, 2018
  12. brian m. carlsonSep 21, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.