Skip to content

Add code formatting check to Travis CI build #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2019
Merged

Add code formatting check to Travis CI build #54

merged 3 commits into from
Apr 8, 2019

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Apr 8, 2019

  • Auto format code
  • Add code formatting check to Travis CI build
  • Use TravisBuddy to comment on PRs that result in a failed CI build

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.

A TravisBuddy webhook was added to the Travis CI build. 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.

Example of a build failure caused by non-compliant code formatting:
https://travis-ci.org/per1234/ArduinoIoTCloud/jobs/517209067

Example of TravisBuddy automated comment on a demonstration pull request that failed the code formatting check:
https://github.com/per1234/ArduinoIoTCloud/pull/1
Clipboard01

Related:

per1234 added 3 commits April 8, 2019 03:58
The Artistic Style code formatter tool was used with Arduino's example_formatter.conf configuration file:
https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
Check compliance with the code style standard established by Arduino's examples_formatter.conf Artistic Style configuration file:
https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf
If the code doesn not comply with the standard, a diff between the submitted code and the auto-formatted code is shown in the log.

I did some reorganization of .travis.yml so that the formatting check was done in a single dedicated Travis CI job, rather than redundantly in every one of the jobs.
When the Travis CI build of a pull request fails, TravisBuddy automatically comments. This will cause the pull request author to get a notification and hopefully resolve the issue without the need for any action from one of the repository maintainers.
@aentinger aentinger merged commit eea7504 into arduino-libraries:master Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants