Mailinglist Archive: yast-devel (48 mails)

< Previous Next >
Re: [yast-devel] consistent indentation with
Thanks Martin for the info.

I think is a good idea to have our own ".editorconfig" at some place. Maybe we could add it to yast-devtools and deploy the file in the user home?

Regarding the rules, I would add both: trim_trailing_whitespace and insert_final_newline. I see none case where they could be a problem.

And for the special libstorage-ng rules, I would keep them only in the libstorage-ng repository. They are quite particular. In fact, I have been reviewing some C++ style guides (there are quite some) and almost all of them avoid to use tabs. So, in our default ".editorconfig" I would use other rules for cpp files.

On 6/17/19 12:19 PM, Martin Vidner wrote:

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

To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >