[Rpm-maint] [rpm-software-management/rpm] Add .editorconfig, and note in CONTRIBUTING doc (PR #3219)

Frank Dana notifications at github.com
Mon Jul 29 22:46:53 UTC 2024


After reading the formatting instructions in [CONTRIBUTING](/CONTRIBUTING.md), I realized that the repo was crying out for an `.editorconfig` file to define the appropriate settings.

[EditorConfig](https://editorconfig.org/) enjoys _wide_ support across all text editors commonly used for coding (and plenty that aren't), either via built-in integration or through an appropriate extension/plugin. It uses an ini-style syntax to set formatting rules for various files (which can be named or wildcard-matched, typically by extension). Like `.gitignore` or other configuration files, `.editorconfig` files are hierarchical, meaning they can be installed at multiple levels in a directory tree to recursively merge rules at various levels. (A feature not currently used here.)

While the supported rules vary from editor to editor, there are certain "core" rules that all editors can be expected to honor.

The file as submitted here sets the following rules:

### For all files
Charset is `utf-8`, line-endings are LF (not CRLF), and files should automatically end with a newline.

Commented out is a rule to remove trailing whitespace, because there is far too much trailing whitespace in the existing code so it would introduce too many spurious changes when editing existing files. Perhaps a later PR could clean these up and uncomment the rule for future editors.

### For .c, .h, .h.in, .pc, and .pc.in files
Additionally apply the code-formatting rules specified in the CONTRIBUTING file (4-column indentation, tab indents, and 8-column tabs).

### For .md files
Configure 4-space indents. (See #3218 for why tab indents and markdown don't really mix.)
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/3219

-- Commit Summary --

  * Add .editorconfig, and note in CONTRIBUTING doc

-- File Changes --

    A .editorconfig (17)
    M CONTRIBUTING.md (13)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/3219.patch
https://github.com/rpm-software-management/rpm/pull/3219.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3219
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3219 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20240729/cb98e9b2/attachment.html>


More information about the Rpm-maint mailing list