This repository was archived by the owner on Aug 18, 2020. It is now read-only.
Add code formatting check to Travis CI build #29
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check compliance with the Artistic Style code formatter configuration found in https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf. A consistent style will be used for example sketches as well as library code.
This required first doing an auto format of all the code in the repository.
I excluded the
./src/lib
and./test/external
folders from the auto formatting and the formatting check because these appeared to contain only external projects. I felt that it didn't make sense to enforce a formatting standard on these projects, since that would likely make it more difficult to update these files and to view changes between updates. If you do want me to enable formatting checks on any of these folders, let me know, I'm happy to update this PR accordingly.A TravisBuddy webhook was added to the Travis CI build configuration. TravisBuddy will automatically comment on any pull request that results in a failing Travis CI build so that the author of the PR will get a notification of the issue and hopefully resolve it without the need for any action from a repository maintainer.
Example of a build failure caused by non-compliant code formatting:
https://travis-ci.org/per1234/ArduinoCloudThing/jobs/517619571
Example of TravisBuddy automated comment on a demonstration pull request that failed the code formatting check:

https://github.com/per1234/ArduinoCloudThing/pull/1
Related: