nasa / fprime-tools

F´ Python tooling and helpers.
https://github.com/nasa/fprime
Apache License 2.0
21 stars 39 forks source link

Fix for old clang-format #199

Closed JohanBertrand closed 3 months ago

JohanBertrand commented 6 months ago
Related Issue(s)
Has Unit Tests (y/n)
Documentation Included (y/n)

Change Description

Clang-format did not support a file path in its --style=file parameter before clang-format 14.0.

The current default clang format on ubuntu 20.04 is 10.0, and is not compatible with the current version of the tool, which is (I guess), responsible of some issues for users (see https://github.com/nasa/fprime/discussions/1101#discussioncomment-5532517)

This MR restores compatibility with older clang-format versions.

I also added distinction between verbose and quiet options for the formatter.

Rationale

Restore compatibility with older clang-format versions

JohanBertrand commented 6 months ago

I reverted a change in the subprocess.run() call, since my change did not have any impact on the execution of the function

JohanBertrand commented 4 months ago

@LeStarch @thomas-bc Is there anything you would want me to do here before merging this PR?

LeStarch commented 4 months ago

@thomas-bc I am ok with the change. Your thoughts?

thomas-bc commented 3 months ago

I am ok with those changes. Sorry for the delay. Let's implement the following in another PR:

having fprime-util format check the existence of a .clang-format file at the root of the project and if it doesn't exist -> automatically create one. This gently pushes for best practice, and will ensure older projects get up to speed on this new file that should be at the root of the project.