arduino / arduino-examples

Arduino IDE bundled examples
Creative Commons Zero v1.0 Universal
92 stars 42 forks source link

Add CI workflows for compilation testing, spell check, and formatting check #1

Closed per1234 closed 4 years ago

per1234 commented 4 years ago

These GitHub Actions workflows will:


NOTE: The failure of the Compile Examples workflow run is due to legitimate compilation errors.

These should be resolved by either:

Or

That work is out of scope for this PR.

silvanocerza commented 4 years ago

PR approved but I have a question nonetheless, why are we using astyle instead of something else like clang-format?

per1234 commented 4 years ago

why are we using astyle

I chose it because astyle is the tool used by the Arduino IDE's Tools > Auto Format feature and also used by the manually run formatter script.

Although the formatter configuration defined by examples_formatter.conf does add a few additional things, my primary goal is for the examples to always be compliant with the formatting style established by the default auto format settings. It seems like this can most easily be achieved by using the same formatter tool for the check. My concern with using a different formatter tool is that there might be some subtle differences in the formatting. I haven't investigated this at all though.

I'm certainly open minded about other tools, but I'll ask you the opposite question: Why not use astyle?

silvanocerza commented 4 years ago

Just a matter of personal preference in this case, I've always used clang-format with C++ so I feel comfortable using that instead of astyle.

If it's already used by the Arduino IDE I'm fine with it.

ubidefeo commented 4 years ago

@silvanocerza I remember a while back (actually one of my first interactions with @per1234 ) I was trying to get clang-format to get the format right for Arduino IoT Cloud examples in SublimeText. I ended up trying so many things and failing that in the end I embraced Per's instructions and went with it. Also, I have since removed every bit of knowledge about how to do that and I'm a happier person :D