Skip to content
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

AStyle CI checker is dead. We need a replacement. #229

Closed
SpenceKonde opened this issue Jan 15, 2022 · 3 comments
Closed

AStyle CI checker is dead. We need a replacement. #229

SpenceKonde opened this issue Jan 15, 2022 · 3 comments

Comments

@SpenceKonde
Copy link
Owner

SpenceKonde commented Jan 15, 2022

Continuous disintegration is more like it. Second CI checker to vanish in a puff of smoke in a month..

Anyone know what happened? I would really like to get something that serves to catch poor formatting...

Homepage linked in the log output doesn't resolve as a domain name.

@SpenceKonde SpenceKonde changed the title AStyle CI checker is dead. What the bloody hell is it now? last month markdownlint blew up, now astyle? AStyle CI checker is dead. We need a replacement. Jan 19, 2022
@per1234
Copy link
Contributor

per1234 commented Jan 22, 2022

Hi @SpenceKonde. Would you mind providing some details about the AStyle situation? I'll take a look.

If you are talking about the "Check code formatting" GitHub Actions workflow, I see the last run passed just fine:
https://github.com/SpenceKonde/DxCore/actions/runs/1710007838

Something important to keep in mind when using GitHub Actions is that the service is subject to frequent transient network outages. So don't immediately assume that an odd failure is the result of some permanent state. You can sometimes get a feel for the situation by checking this page:
https://www.githubstatus.com/

but that lags behind the actual situation on the ground, so you might see ✅ for some time even when everything is completely broken.

A bit more real time is often the user comments on the latest tweet from this account:
https://twitter.com/githubstatus


As for a replacement, I am now recommending the use of ClangFormat, as this is the tool used for Auto Format by Arduino IDE 2.x. ClangFormat is also very actively maintained, in contrast with the unmaintained Artistic Style. There is a GitHub Actions workflow template here:
https://github.com/per1234/.github/blob/main/workflow-templates/check-cpp.md

The template includes a configuration file that is the same one used by the Arduino IDE 2.x auto formatter, and so represents the closest thing to the official Arduino code style. I did everything I could to make the ClangFormat configuration match with the Artistic Style configuration used by the Arduino IDE 1.x Auto Format, so hopefully the change of tools will not be too disruptive. Unfortunately, it was not possible to get a perfect match between the two configurations. The mismatch came because Arduino's Artistic Style configuration was very "hands off", while ClangFormat simply doesn't play that way. ClangFormat will let you chose any style you like, but usually doesn't provide an "I don't care" setting.

@SpenceKonde
Copy link
Owner Author

Yeah, that action specifically had vanished and was failing with a hostname not resolved for several days.

I will have to look at that clangformat, it looks like it offers the flexibility that would let me start stylechecking the core proper (which is curently excluded because it astyle doesn't let you indent all preprocessor conditionals, and I can't read my own code without that))

@per1234
Copy link
Contributor

per1234 commented Jan 24, 2022

The per1234/artistic-style-action action used in that workflow is something I created (it actually was made specifically for SpenceKonde/megaTinyCore#236). I haven't done anything to it so I'm sure the problem wasn't related to my repo. But my action downloads Artistic Style from its resting place on SourceForge, so it might have been a transient outage in that system.

Even though I am now recommending ClangFormat, I will definitely keep the Artistic Style action alive. It is a fairly simple action, so not likely to require frequent maintenance.

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

No branches or pull requests

2 participants