Add .editorconfig file 75/49375/7
authorUmesh Singla <umeshksingla@gmail.com>
Wed, 14 Dec 2016 18:03:44 +0000 (23:33 +0530)
committerVratko Polák <vrpolak@cisco.com>
Tue, 31 Jan 2017 09:21:36 +0000 (09:21 +0000)
Different file formats have separate sections.
Add rules as you see gaps.

Link to style-guide followed, present before each section

Change-Id: I4101e6bcd27f16bc554d70ade177089f9572db6d
Signed-off-by: Umesh Singla <umeshksingla@gmail.com>
.editorconfig [new file with mode: 0644]

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..97d3f7e
--- /dev/null
@@ -0,0 +1,88 @@
+# Text editor configuration file
+#
+# Note: Find the link to the style-guide followed, before each section
+
+root = true
+
+# General rules
+# -------------
+# - Unicode
+# - Unix-style line endings
+# - Newline before EOF
+# - No sloppy trailing spaces
+# - Use 4 indent spaces if there's no clear external normal style
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+indent_style = space
+
+# https://wiki.opendaylight.org/view/Integration/Test/Test_Code_Guidelines
+[*.robot]
+indent_size = 4
+
+# https://github.com/bbatsov/ruby-style-guide#source-code-layout
+[*.rb]
+charset = utf-8
+indent_size = 2
+max_line_length = 80
+
+# https://google.github.io/styleguide/shell.xml
+# Preferred 4 spaces over 2 in styleguide since 4 highlights the indent better
+# as agreed by the community on Gerrit
+[*.sh]
+indent_size = 4
+max_line_length = 80
+
+# https://www.python.org/dev/peps/pep-0008/
+[*.py]
+charset = utf-8
+indent_size = 4
+max_line_length = 79
+
+# http://documentation-style-guide-sphinx.readthedocs.io/en/latest/style-guide.html
+[*.rst]
+indent_size = 2
+max_line_length = 79
+trim_trailing_whitespace = false
+
+# Nothing specified for json files, so going with 4 indent_size as per Coala
+# json - https://google.github.io/styleguide/jsoncstyleguide.xml
+[*.json]
+indent_size = 4
+
+# http://xmlsoft.org/xmllint.html
+# Preffered 4 over 2 in styleguide
+[*.xml]
+indent_size = 4
+
+# http://yamllint.readthedocs.io/en/latest/
+[*.{yaml,yml}]
+indent_size = 4
+
+# Trailing spaces in markdown is used to differentiate line breaks and paragraphs
+[*.{md,markdown}]
+indent_size = 4
+trim_trailing_whitespace = false
+insert_final_newline = false
+
+# No style-guide, so fix 4
+[Vagrantfile]
+indent_size = 4
+
+[Dockerfile]
+indent_size = 4
+
+# Keep same as for ruby
+[Gemfile]
+indent_size = 2
+
+# https://docs.puppet.com/guides/style_guide.html
+[*.pp]
+indent_size = 2
+max_line_length = 140
+
+# Keep same as for ruby
+[*.erb]
+indent_size = 2