Github messages for voidlinux
 help / color / mirror / Atom feed
From: 0x5c <0x5c@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC] add EditorConfig file
Date: Tue, 05 Mar 2024 15:57:46 +0100	[thread overview]
Message-ID: <20240305145746.BF4DA242C6@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48808@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages editor-config
https://github.com/void-linux/void-packages/pull/48808

[RFC] add EditorConfig file
This PR adds an [EditorConfig](https://editorconfig.org) file to help following the general style used in the repo, along with xlint.

EditorConfig is supported by many editors (see previous link), and automatically adjusts editor settings for indentation, line endings, encoding, etc for a file based on rules. Editors that support it don't act as reformatters when saving; they only use the settings for additions and new files (just as if you has manually changed those settings), which should help new lines and new files follow basic style without user intervention and without generating large "reformat" git diffs[^1].

The exact rules in this PR are just what I surmised to be "the style", namely:
- utf-8, `lf` line-endings, no trailing whitespace at end of lines, and final newline for all files (mostly "files on linux in git")
- 4 space indent for markdown, 2 space indent for YAML
- tab indent for xbps-src and `template`/`update` (done in the everything glob)


[^1]: While that is the case, there are also linters/formatters that can use the `.editorconfig` file if a wholesale reformat is desired.

A patch file from https://github.com/void-linux/void-packages/pull/48808.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-editor-config-48808.patch --]
[-- Type: text/x-diff, Size: 977 bytes --]

From 5ac69d9ee297ca9422cc2edde21c64c664dba63e Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Sun, 18 Feb 2024 01:30:53 -0500
Subject: [PATCH] add EditorConfig file

---
 .editorconfig | 16 ++++++++++++++++
 .gitignore    |  1 +
 2 files changed, 17 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000000000..85d588a66e1d70
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+root = true
+
+[*]
+indent_style = tab
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+indent_size = 4
+indent_style = space
+
+[*.{yml,yaml}]
+indent_size = 2
+indent_style = space
diff --git a/.gitignore b/.gitignore
index 0a1b2da0284e7c..e91ff787554d57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
 
 # exclude everything in root except files and directories from void-packages
 /*
+!/.editorconfig
 !/.gitattributes
 !/.github
 !/.gitignore

  reply	other threads:[~2024-03-05 14:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18  7:46 [PR PATCH] " 0x5c
2024-03-05 14:57 ` 0x5c [this message]
2024-03-05 14:58 ` [PR PATCH] [Updated] " 0x5c
2024-03-05 15:01 ` 0x5c
2024-03-05 15:49 ` [PR PATCH] [Updated] " 0x5c
2024-03-05 15:50 ` 0x5c
2024-03-05 16:03 ` 0x5c
2024-03-07 23:59 ` [PR PATCH] [Merged]: " classabbyamp

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=20240305145746.BF4DA242C6@inbox.vuxu.org \
    --to=0x5c@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).