diff --git a/src/fprime/util/code_formatter.py b/src/fprime/util/code_formatter.py index ace42be8..45f8f4cd 100644 --- a/src/fprime/util/code_formatter.py +++ b/src/fprime/util/code_formatter.py @@ -51,6 +51,7 @@ def __init__(self, executable: str, style_file: "Path", options: Dict): self.style_file = style_file self.backup = options.get("backup", True) self.verbose = options.get("verbose", False) + self.quiet = options.get("quiet", False) self.validate_extensions = options.get("validate_extensions", True) self.allowed_extensions = ALLOWED_EXTENSIONS.copy() self._files_to_format: List[Path] = [] @@ -143,11 +144,18 @@ def execute( clang_args = [ self.executable, "-i", - f"--style=file:{self.style_file}", - *(["--verbose"] if self.verbose else []), + f"--style=file", + *(["--verbose"] if not self.quiet else []), *pass_through, *self._files_to_format, ] + if self.verbose: + print("[INFO] Clang format executable:") + print(f"[INFO] {self.executable}") + print("[INFO] Clang format arguments:") + print(f"[INFO] {clang_args[1:]}") + print("[INFO] Clang format style file:") + print(f"[INFO] {self.style_file}") status = subprocess.run(clang_args) self._postprocess_files() return status.returncode diff --git a/src/fprime/util/commands.py b/src/fprime/util/commands.py index 6b0d40d0..d083ae8b 100644 --- a/src/fprime/util/commands.py +++ b/src/fprime/util/commands.py @@ -160,7 +160,8 @@ def run_code_format( ____: unused pass-through arguments """ options = { - "verbose": not parsed.quiet, + "quiet": parsed.quiet, + "verbose": parsed.verbose, "backup": not parsed.no_backup, "validate_extensions": not parsed.force, }