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

Re: [PATCH] Add an EditorConfig file

From
Taylor Blau <me@ttaylorr.com>
Date
Sep 17, 2018, 23:18 UTC
Message-ID
<20180917231850.GB81083@syl>
In-Reply-To
<20180917230307.588334-1-sandals@crustytoothpaste.net>
Hi brian,
Thanks for CC-ing me on this.

I use editorconfig every day via the configuration in my home directory [1], and the Vim plugin editorconfig-vim [2]. It's a great piece of software, and I've been using it without any issue since around the beginning of 2015.

On Mon, Sep 17, 2018 at 11:03:07PM +0000, brian m. carlson wrote:
> Regardless, providing such a file allows users to automatically
> configure their editor of choice with the correct settings by default.

I think that this is the central argument to be made here for keeping this out of contrib/, and in the root tree. Most editor (all?) plugins will pick this location up automatically, which ought to cut down on patches that aren't formatted correctly.

Show 11 quoted lines
> 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.
>
> 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.

Good. Even the official editorconfig documentation specifies that this ought to be the responsibility "of the VCS" [3], a point on which I agree.

> +[*.{c,h,sh,perl}]
> +indent_style = tab
> +tab_width = 8

In all *.[ch] files in git.git, I found a total of 817 lines over 79 characters wide:

  $ for file in $(git ls-files '**/*.[ch]'); do
      awk 'length > 79' $f;
    done | wc -l

So I think that specifying indent_style, and tab_width to be 'tab' and '8' respectively is enough. We shouldn't be enforcing a rule about line lengths that we are not ourselves consistently following.

Have you thought about including guidelines on COMMIT_EDITMSG? We prefer 72 characters per line [3], and this is enforceable via the following:

  [COMMIT_EDITMSG]
  max_line_length = 72

Thanks, Taylor

[1]: https://github.com/ttaylorr/dotfiles/blob/work-gh/editorconfig/.editorconfig [2]: https://github.com/editorconfig/editorconfig-vim [3]: http://public-inbox.org/git/20170930070127.xvtn7dfyuoh26mhp@sigill.intra.peff.net

Previous: brian m. carlsonNext: brian m. carlson
Message 2 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.