Add editorconfig
ClosedPublic

Authored by lbergdoll on Sep 9 2018, 4:39 PM.

Details

Summary

Defaults taken from kde coding style.
This file enables a minimum style guide to be enforced across editors,
like line endings, character encoding, tabs vs spaces, indent size
and some more.
https://editorconfig.org/

Diff Detail

Repository
R319 Konsole
Branch
add-editorconfig
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 2970
Build 2988: arc lint + arc unit
lbergdoll created this revision.Sep 9 2018, 4:39 PM
Restricted Application added a project: Konsole. · View Herald TranscriptSep 9 2018, 4:39 PM
Restricted Application added a subscriber: konsole-devel. · View Herald Transcript
lbergdoll requested review of this revision.Sep 9 2018, 4:39 PM
lbergdoll added inline comments.Sep 9 2018, 4:42 PM
.editorconfig
5

https://community.kde.org/Policies/Kdelibs_Coding_Style this style guide does not differentiate between different file types, note specific rules for specific file types can easily be added.

11

This is a recommendation and most editors do not enforce it.

16

This has to do with markdown and the way it handles line breaks.

I think the idea in general is good. +1 from my side, things can still be improved later if it turns out that it does not work.

PS: indeed, we do not have a hard word wrap for the line length. Maybe remove this line :)
PPS: alternatively, one could add a .kateconfig file. Kate supports .editor config as well, though.

PPS: alternatively, one could add a .kateconfig file. Kate supports .editor config as well, though.

That would defeat the purpose of this, this file is about making collaborative project editing easier. Not every developer uses kate. Actually the opposite, In the last stackoverflow survey it didn't even make the 0.2% mark for desktop developers: https://insights.stackoverflow.com/survey/2017#technology-most-popular-developer-environments-by-occupation.

@hindenburg I see no blocker for this, excluding maybe line length, yet that is as the comment says more a suggestion than a hard limit.

I'm not against this per se but why does every application need this in its source folder?

For reference: https://editorconfig.org/

I'm not against this per se but why does every application need this in its source folder?

For reference: https://editorconfig.org/

How else would you achieve this?

I'm not against this per se but why does every application need this in its source folder?

For reference: https://editorconfig.org/

How else would you achieve this?

Like most other editors, have something in ~; this would be ~/.editorconfig

Like most other editors, have something in ~; this would be ~/.editorconfig

? Again that defeats the purpose of this thing. The whole point is that different projects can have different styles and that your editor does not impose its settings on the project, your development environment should pick up the project settings. What you suggest is bit like suggestion a global package.json for all npm projects.

hindenburg edited the summary of this revision. (Show Details)Sep 16 2018, 10:50 PM

I second @lbergdoll , Different projects have different setups (like tabs vs spaces), having this file on the repository would help people that don't know the code style to have a head start.

tcanabrava accepted this revision.Sep 17 2018, 7:13 AM
This revision is now accepted and ready to land.Sep 17 2018, 7:13 AM
gszymaszek requested changes to this revision.Sep 17 2018, 12:16 PM
gszymaszek added inline comments.
.editorconfig
2

https, please 🙂

15

I think it’s better to suggest some line length limit in Markdown files as well, as it makes these files readable in plain text (incapable of Markdown previewing or of text soft wrapping, like mcedit) editors. Like it’s in cgit/syntax-highlighting/tree/README.md

19

Is it really a good idea?

This revision now requires changes to proceed.Sep 17 2018, 12:16 PM
lbergdoll updated this revision to Diff 41860.Sep 17 2018, 6:24 PM
  • https
  • remove special line length cases
gszymaszek accepted this revision.Sep 17 2018, 7:34 PM
This revision is now accepted and ready to land.Sep 17 2018, 7:34 PM
Omar added a subscriber: Omar.Sep 18 2018, 1:32 AM

Seconding this. Having application agnostic setting is a great idea.

hindenburg accepted this revision.Sep 18 2018, 1:31 PM
This revision was automatically updated to reflect the committed changes.