From 71d7572950e9266fcf54a9278a948f6b88fa495b Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Sun, 19 Feb 2023 16:08:54 -0300 Subject: [PATCH] editorconfig: add indentation rules Commands used to list the file extensions used in the project: $ git ls-files | sed -En 's/.*(\.[^.]+)$/\1/p' | LC_ALL=C sort | uniq -c For rules that are more specific to a given directory, put a dedicated .editorconfig file in it. --- .editorconfig | 27 +++++++++++++++++++++++++++ .github/.editorconfig | 3 +++ contrib/syntax/.editorconfig | 7 +++++++ platform/rpm/.editorconfig | 3 +++ src/bash_completion/.editorconfig | 3 +++ src/zsh_completion/.editorconfig | 3 +++ 6 files changed, 46 insertions(+) create mode 100644 .github/.editorconfig create mode 100644 contrib/syntax/.editorconfig create mode 100644 platform/rpm/.editorconfig create mode 100644 src/bash_completion/.editorconfig create mode 100644 src/zsh_completion/.editorconfig diff --git a/.editorconfig b/.editorconfig index f999431de..7d98c1b14 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,3 +5,30 @@ charset = utf-8 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true + +# Build +[configure.ac] +indent_size = 8 +indent_style = tab + +[*{.mk,Makefile}{,.in}] +indent_size = 8 +indent_style = tab + +# Source code and scripts +[*.{c,h}{,.in}] +indent_size = 8 +indent_style = tab + +[*.{awk,exp,sh}{,.in}] +indent_size = 8 +indent_style = tab + +[*.py{,.in}] +indent_size = 4 +indent_style = space + +# Misc +[.gitlab-ci.yml] +indent_size = 4 +indent_style = space diff --git a/.github/.editorconfig b/.github/.editorconfig new file mode 100644 index 000000000..eb5c699c5 --- /dev/null +++ b/.github/.editorconfig @@ -0,0 +1,3 @@ +[*.yml] +indent_size = 2 +indent_style = space diff --git a/contrib/syntax/.editorconfig b/contrib/syntax/.editorconfig new file mode 100644 index 000000000..385bf17d5 --- /dev/null +++ b/contrib/syntax/.editorconfig @@ -0,0 +1,7 @@ +[*.lang{,.in}] +indent_size = 2 +indent_style = space + +[*.vim{,.in}] +indent_size = 2 +indent_style = space diff --git a/platform/rpm/.editorconfig b/platform/rpm/.editorconfig new file mode 100644 index 000000000..964dd36dd --- /dev/null +++ b/platform/rpm/.editorconfig @@ -0,0 +1,3 @@ +[*.sh{,.in}] +indent_size = 4 +indent_style = space diff --git a/src/bash_completion/.editorconfig b/src/bash_completion/.editorconfig new file mode 100644 index 000000000..298a13b5e --- /dev/null +++ b/src/bash_completion/.editorconfig @@ -0,0 +1,3 @@ +[*.bash_completion{,.in}] +indent_size = 4 +indent_style = space diff --git a/src/zsh_completion/.editorconfig b/src/zsh_completion/.editorconfig new file mode 100644 index 000000000..15ca952a4 --- /dev/null +++ b/src/zsh_completion/.editorconfig @@ -0,0 +1,3 @@ +[_*{,.in}] +indent_size = 4 +indent_style = space