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

Tools: Recommend what to do when astyle fails #28557

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ryanf55
Copy link
Collaborator

@Ryanf55 Ryanf55 commented Nov 8, 2024

Purpose

Tell developers what to do if the astyle check fails.

Motivation

ArduPilot/ardupilot_wiki#6292 (comment)

Demo

This is what a developer will see if they push code and CI fails.

Specifically, we went from:

****** Files needing formatting found.

to:

****** Files needing formatting found. Please run ./Tools/scripts/run_astyle.py

In the screenshot below, I intentionally broke formatting in AP_DDS_Client.h. This is what the script will display in CI.
image

Signed-off-by: Ryan Friedman <[email protected]>
@@ -60,7 +60,7 @@ def check(self):
self.progress("astyle check failed: (%s)" % (ret.stdout))
self.retcode = 1
if "Formatted" in ret.stdout:
self.progress("Files needing formatting found")
self.progress("Files needing formatting found. Please run ./Tools/scripts/run_astyle.py")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really strange thing to be printing in run_astyle.py!

If this is intended to make CI clearer, grepping the output of the dry-run might be a better idea.

Copy link
Collaborator Author

@Ryanf55 Ryanf55 Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your expectation that we only print this in build_ci.sh? I don't see why we need to grep when we can just check the return code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants