Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] add EditorConfig file
@ 2024-02-18  7:46 0x5c
  2024-03-05 14:57 ` [PR PATCH] [Updated] " 0x5c
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: 0x5c @ 2024-02-18  7:46 UTC (permalink / raw)
  To: ml

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

There is a new 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 ba75618f46bc3d09d8573e04849cf6a4d14f6300 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
@ 2024-03-05 14:57 ` 0x5c
  2024-03-05 14:58 ` 0x5c
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 14:57 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
  2024-03-05 14:57 ` [PR PATCH] [Updated] " 0x5c
@ 2024-03-05 14:58 ` 0x5c
  2024-03-05 15:01 ` 0x5c
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 14:58 UTC (permalink / raw)
  To: ml

[-- 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: 1079 bytes --]

From 403882bb349034fd4f2fd959fad30a31259a79f7 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 | 21 +++++++++++++++++++++
 .gitignore    |  1 +
 2 files changed, 22 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000000000..5120428c649a70
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,21 @@
+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
+
+[*.{patch,diff}]
+indent_style = unset
+end_of_line = unset
+trim_trailing_whitespace = unset
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
  2024-03-05 14:57 ` [PR PATCH] [Updated] " 0x5c
  2024-03-05 14:58 ` 0x5c
@ 2024-03-05 15:01 ` 0x5c
  2024-03-05 15:49 ` [PR PATCH] [Updated] " 0x5c
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 15:01 UTC (permalink / raw)
  To: ml

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

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/48808#issuecomment-1978969719

Comment:
With feedback from @oreo639, I've added a exemption of whitespace/endings/indents for patches, based on the extension to catch cases where a patch is in the `files/` folder.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
                   ` (2 preceding siblings ...)
  2024-03-05 15:01 ` 0x5c
@ 2024-03-05 15:49 ` 0x5c
  2024-03-05 15:50 ` 0x5c
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 15:49 UTC (permalink / raw)
  To: ml

[-- 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: 1097 bytes --]

From a302c4d961cfd8f5c1374fa63256b694e753f3ca 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 | 22 ++++++++++++++++++++++
 .gitignore    |  1 +
 2 files changed, 23 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000000000..002ee905c80322
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,22 @@
+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
+
+[*.{patch,diff}]
+indent_style = unset
+end_of_line = unset
+charset = unset
+trim_trailing_whitespace = unset
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 15:50 UTC (permalink / raw)
  To: ml

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

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/48808#issuecomment-1979083980

Comment:
After checking what encodings we have in patches, I decided to also add an encoding exception for patches.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
                   ` (4 preceding siblings ...)
  2024-03-05 15:50 ` 0x5c
@ 2024-03-05 16:03 ` 0x5c
  2024-03-07 23:59 ` [PR PATCH] [Merged]: " classabbyamp
  6 siblings, 0 replies; 8+ messages in thread
From: 0x5c @ 2024-03-05 16:03 UTC (permalink / raw)
  To: ml

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

New comment by 0x5c on void-packages repository

https://github.com/void-linux/void-packages/pull/48808#issuecomment-1978969719

Comment:
With feedback from @oreo639, I've added an exemption of whitespace/endings/indents for patches, based on the extension to catch cases where a patch is in the `files/` folder.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PR PATCH] [Merged]: [RFC] add EditorConfig file
  2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
                   ` (5 preceding siblings ...)
  2024-03-05 16:03 ` 0x5c
@ 2024-03-07 23:59 ` classabbyamp
  6 siblings, 0 replies; 8+ messages in thread
From: classabbyamp @ 2024-03-07 23:59 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

[RFC] add EditorConfig file
https://github.com/void-linux/void-packages/pull/48808

Description:
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-03-07 23:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18  7:46 [PR PATCH] [RFC] add EditorConfig file 0x5c
2024-03-05 14:57 ` [PR PATCH] [Updated] " 0x5c
2024-03-05 14:58 ` 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

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).