Mailinglist Archive: yast-devel (48 mails)

< Previous Next >
[yast-devel] consistent indentation with

some time ago I started using a new code editor[1], and I found that unlike my
other editor[2] it has difficulties in divinating the indentation styles of
various code bases.

Fortunately, a reasonable standard has emerged that lets a code base declare
how to indent, in a way that editors can easily understand:

Here's a declaration I've been using for our Ruby code:

# top-most EditorConfig file
root = true

# 2 space indentation
indent_style = space
indent_size = 2

And here's the one from libstorage-ng, capturing the not-quite-trivial rules
of "the Tab key indents 4 columns, but compress 8 spaces into Tab characters"

# -*- ini -*-
# This is a unified way to tell all your editors
# about the proper indentation style in this repo.
# Emacs:
# Vim:
# VS Code:

# don't continue looking in upper directories, this is the top level
root = true

indent_style = tab
indent_size = 4
tab_width = 8

I've added it to a couple of repos so far, where I needed it.

1. Should we improve these declarations? (Add
trim_trailing_whitespace[3], insert_final_newline)
2. Should we add a master copy to yast-devtools? (It would need to be copied
manually, but it would serve as the representation of the current best

thanks to Lada for prompting this
Martin Vidner, YaST Team
< Previous Next >