lbryio / lbrycrd

The blockchain that provides the digital content namespace for the LBRY protocol
https://lbry.com
MIT License
2.57k stars 178 forks source link

Run code formatting checks on travis #163

Closed kaykurokawa closed 6 years ago

kaykurokawa commented 6 years ago

Added an option on reproducible_build.sh to run a code formatting check on any commits not on master (by default this option is off). Travis will use this option and build will fail if it finds any lines that needs to be formatted.

For https://github.com/lbryio/lbrycrd/issues/157

lyoshenka commented 6 years ago

:+1: this is the only way to enforce code styles, imho

kaykurokawa commented 6 years ago

Brought in the latest .clang-format and developer docs from Bitcoin Core. We should follow these from now on.

reproducible_build.sh has a new option flag -f that will run a code formatting check on any commit not on master using .clang-format before building. On travis, the build will fail if there are any code formatting issues on your commits.

If you want to run just the code formatting check script, I added a line in README on how to do that.

Added some comments on README about dealing with changes that we bring in from Bitcoin Core that is not expected to be used when we do a full merge from upstream (i.e. updating to the lastet Core version). Note that e9369eb is one of those commits.

lbrynaut commented 6 years ago

@kaykurokawa This looks good to me (although what happens if the style fails -- just a travis failure?). If you want to merge and create the release including the OS X build, maybe this is a good spot to do it.

kaykurokawa commented 6 years ago

Yes if the style fails for the commits, travis will refuse to build