hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
152 stars 83 forks source link

Format code automatically during compile using google-java-format #53

Closed timcharper closed 5 years ago

timcharper commented 5 years ago

There's lot of inconsistent uses of tabs vs spaces throughout the project, and this is leading to some weird diffs. I submit the project should just enforce formatting during compile time and just remove any doubt. This way contributors won't need to update their Eclipse configuration to match, as long as they run mvn compile, it'll format correctly.

timcharper commented 5 years ago

I've split this PR up in to two commits; 2008ca849222857e567f8d1cd7967e97f8036e8a just adds the plugin, and then adf7af0b5e80528d3435209b169777ef92981276 adds the result of running the formatter. It gives me a ton of credit, so you may wish to just merge the first commit and then run and commit the results yourself :)

Ignoring whitespace makes the 2nd patch easier to read.

https://github.com/beowulfe/HAP-Java/pull/53/commits/adf7af0b5e80528d3435209b169777ef92981276?utf8=✓&diff=split&w=1

timcharper commented 5 years ago

@beowulfe any opinion on this?

andylintner commented 5 years ago

Thanks for doing that @timcharper - much cleaner!