Commit Graph

8 Commits

Author SHA1 Message Date
Chris Beams
b4ee9d33e5
Do not strip trailing whitespace in Git diffs
Problem: Editorconfig was configured to strip trailing whitespace in all
file types. This is generally a good thing, but when interactive
rebasing with Git and editing the contents of a commit, trailing
whitespace is significant on blank lines and must be preserved in order
for edits to be applied cleanly.

Solution: Update Editorconfig to exclude *.diff from the strip
whitespace rule, as interactive rebasing edits are done in a temporary
file with a '.diff' suffix.
2020-01-10 19:48:26 +01:00
Chris Beams
c347d9c225
Update .editorconfig to use hard tabs in Makefile
Problem: we use soft 4-space tabs throughout the Bisq codebase, and the
new makefile is a break to this rule due to make's default requirement
for hard tabs in recipes.

Solution: This commit updates our Editorconfig settings to reflect this
exception.

For vim users, it is also recommended that you add the following entry
to your .vimrc:

     au FileType make set tw=72 noet cc=72

It will ensure that you wrap (documentation) lines at 72 chars. It also
sets noexpandtab explicitly. Even though .editorconfig should already be
doing this for you when working in Bisq, this more general vim
configuration will ensure you use tabs correctly in any makefile. The
`cc=72` setting adds a visual right margin at 72 characters.

This commit also updates the existing makefile, wrapping lines of
documentation that had exceeded the 72-char margin.
2019-12-02 17:52:28 +01:00
Chris Beams
9f4f5c48e1
Preserve CRLF line endings in .bat files
This is specifically for the gradlew.bat file generated by the `gradle
wrapper` command. Typically, this file should never be edited, but just
in case it is, this configuration will preserve its original CRLF line
endings.
2018-11-20 14:18:30 +01:00
Chris Beams
86947c976c
Revert to 4-space indentation in build.gradle
Recent changes to dependencyVerification got committed with 8-space
indentation, causing a diff for the whole block. This reverts it to
4-space, which is what is generated by `gradle -q calculateChecksums`.
2018-03-29 19:44:35 +02:00
Chris Beams
63a5aaedf4
Normalize .idea/codeStyles/*.xml EOF newlines
IDEA does strips EOF newlines in these files, so this commit adds an
exception to the usual rule about inserting them. This will avoid
spurious whitespace diffs on these files in the future.
2018-03-16 11:33:38 +01:00
Chris Beams
dc8150e7df
Organize imports
This change adds a .idea/codeStyles/Project.xml file that orders all
imports from higher-level layers to lower-level layers, with blank lines
between different major packages.

The purpose of this approach is to allow the reader to scan the imports
in a file efficiently to understand what kind of work the class does,
what layers it touches, and so forth. Keeping imports clean and ordered
by layer can be a powerful tool in keeping a codebase well organized and
tangle-free over time.

bisq.* packages are always sorted at the top.
2018-03-12 15:21:02 +01:00
Chris Beams
e1a6f87a98
Reformat Java sources with Editorconfig settings
This change is the result of a global reformatting in IDEA now that
`.editorconfig` settings are in place. Note that Editorconfig's
`continuation_indent_size` property [1] was also added and set to 8
here, as this reflects the dominant style already present in the
codebase. i.e. in created a much smaller diff to set the continuation
indent to 8 that would have been created leaving this property out and
letting it default to 4.

[1]: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
2017-11-04 20:11:30 +01:00
Chris Beams
61547d6a83 Add Editorconfig settings
Per https://github.com/bisq-network/docs/blob/master/CONTRIBUTING.adoc.

See comments in #959 for details.
2017-10-20 10:13:19 +02:00