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

Add code formatting command #111

Merged
merged 7 commits into from
Dec 22, 2022
Merged

Conversation

thomas-bc
Copy link
Contributor

Originating Project/Creator
Affected Component fprime-util format
Affected Architectures(s)
Related Issue(s) nasa/fprime#817
Has Unit Tests (y/n) N
Builds Without Errors (y/n) Y
Unit Tests Pass (y/n)
Documentation Included (y/n) Y

Change Description

Adds a new command to fprime-util to make using clang-format with FPrime source code easier (fprime-util format).

Rationale

This is mostly needed because of the access specifier macros in FPrime (e.g. PRIVATE:), which clang-format can't catch on, which resolves in bad formatting.
This new utility wraps around clang-format, replacing the macros before/after processing, and adding some functionality to make it easier to use with FPrime.

Testing/Review Recommendations

Usability is described in help_text.py -- can be easily tested within the core F' repo or any deployment, after a pip install .
Let me know if you can think of any feature/options that could be useful and I can try to add them in.

@thomas-bc thomas-bc added the enhancement New feature or request label Dec 19, 2022
src/fprime/util/cli.py Fixed Show fixed Hide fixed
src/fprime/util/cli.py Outdated Show resolved Hide resolved
src/fprime/util/cli.py Show resolved Hide resolved
@LeStarch LeStarch merged commit 3f7865a into nasa:devel Dec 22, 2022
@thomas-bc thomas-bc deleted the feat/code-format branch October 11, 2023 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants