From 6ad665f6bbe8d3c8e30544bd08ce803493761e03 Mon Sep 17 00:00:00 2001 From: Brandon Payton Date: Fri, 5 May 2023 09:15:27 -0400 Subject: [PATCH] Add editorconfig to help OSS contributors When switching between many different open source code bases, it can be cumbersome to constantly change editor settings in order to respect a given project's basic style preferences. EditorConfig is a popular format for representing those preferences so editors can automatically respect them. Many editors support EditorConfig out of the box, and many others have EditorConfig plugins: https://editorconfig.org/#pre-installed This commit adds an EditorConfig to the ModSecurity project. It is most likely not perfect because the chosen indentation varies a bit throughout the project, but hopefully it provides a good basis for most ModSecurity editing. --- .editorconfig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..f6e08d349e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +indent_style = space +# Scripts without suffixes in the project root tend to indent by two spaces +indent_size = 2 + +# Most of the project files indent by four spaces +[*/**] +indent_size = 4 + +# Test files indent by two spaces +[test/**] +indent_size = 2 + +# The config parser file indents by both two and four spaces, +# so we choose to indent by two spaces as a common denominator. +[*.yy] +indent_size = 2 + +[{Makefile,Makefile.am}] +indent_style = tab +