
Hello all, In order to facilitate collaboration, I propose to use the Java formatting convention as proposed by Eclipse as the "javaConvention". According to my initial investigation, Intellij IDEA's implementation of the default formatting scheme differs from that offered by the Eclipse default quite a bit. I copied the relevant javaConventions.xml file into the reload4j repository [1]. The good news is that Intellij can import javaConventions.xml without trouble. The bad news is that Intellij's and Eclipse's interpretation of this formatting specification differ slightly. Fortunately, the difference relates to Javadoc text and stabilizes after a while. By stabilizes, I mean that formatting in Eclipse and Intellij converge into something which does not change even after repeated formatting by one or the other tools. Comments welcome. [1] https://github.com/qos-ch/reload4j/blob/branch_1.2.18/javaConventions.xml -- Ceki Gülcü Sponsoring SLF4J/logback/reload4j at https://github.com/sponsors/qos-ch

I'm fine with virtually any formatting, however, a) Configuring "end-of-line" markers is important, as CRLF vs LF produces hard-to-manage conflicts in Git. It is configured universally via .gitattributes (see pr 13) Then git would automatically adjust newline markers on commit. b) Please ensure the last line does end with a newline character. In other words, I suggest that **all** lines in a file be the same: they all should end with a newline. Having a newline at the end of the file helps with adding new lines without "modifying" (by adding a newline) the last line. This is typically configured via insert_final_newline = true in .editroconfig. c) File charset to be UTF-8. This is typically configured via charset = utf-8 in .editorconfig. ^^^ the above properties are vendor-neutral, language-neutral (e.g. XML, Markdown, Java, etc), and tool neutral (editors, linters). ----
formatting convention as proposed by Eclipse
I would strongly recommend using **spaces** for formatting. tabs yield insane formatting, especially when the UI can't know "tab width". For example, pom.xml 9 levels of nesting now, and it would result in 9(indentation level)*8(display width of single tab)=72 "characters" of indent in GitHub UI. command-line tools like "git gui", "gitk", "git diff" would use their own understanding of tab width. There are languages that **forbid** tabs. For instance, YAML forbids tabs, and Eclipse doesn't seem to be able to set tab vs space on a per-language basis: https://github.com/eclipse/wildwebdeveloper/issues/372#issuecomment-59748555... All-in-all, I would suggest: 1) Please use spaces for indentation. 2) Prefer vendor-agnostic standards (e.g. .gitattributes, .editorconfig) when possible. Eclipse lags behind in editor/IDE space, so making Eclipse configuration a primary one does not sound right, especially, when better standards exist and are supported out of the box in modern editors and linters. Vladimir
participants (2)
-
Ceki Gülcü
-
Vladimir Sitnikov