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

Handle whitespaces in format command #121

Merged
merged 1 commit into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/fprime/util/code_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def _preprocess_files(self) -> None:
with open(filepath, "r") as file:
content = file.read()
# Replace the strings in the file content
content = re.sub("PROTECTED:", PROTECTED_PRE_PATTERN, content)
content = re.sub("PRIVATE:", PRIVATE_PRE_PATTERN, content)
content = re.sub("STATIC:", STATIC_PRE_PATTERN, content)
content = re.sub("PROTECTED[\s]*:", PROTECTED_PRE_PATTERN, content)
content = re.sub("PRIVATE[\s]*:", PRIVATE_PRE_PATTERN, content)
content = re.sub("STATIC[\s]*:", STATIC_PRE_PATTERN, content)
# Write the file out to the same location, seemingly in-place
with open(filepath, "w") as file:
file.write(content)
Expand Down