Like a few others, I pair clang-format-lint with tj-actions/changed-files to pass a list of modified files to clang-format-lint.
This pairing works great. However, I've noticed the workflow fails when a filepath contains whitespaces:
.
I've been able to trace this bug back to PR #14 which acknowledges the limitation
Details
In the screenshot provided above, the files argument:
I believe this can be solved by extending split_list_arg() to properly parse directories containing whitespaces.
If the whitespaces are escaped using backward slashes, e.g
features/Complex\ Parallax\ Materials/Shaders/ComplexParallaxMaterials/CRPM.hlsli
instead of
Problem
Like a few others, I pair clang-format-lint with tj-actions/changed-files to pass a list of modified files to clang-format-lint. This pairing works great. However, I've noticed the workflow fails when a filepath contains whitespaces:
.
I've been able to trace this bug back to PR #14 which acknowledges the limitation
Details
In the screenshot provided above, the files argument:
Becomes split by
split_list_arg()
into:Possible Solution
I believe this can be solved by extending
split_list_arg()
to properly parse directories containing whitespaces. If the whitespaces are escaped using backward slashes, e.gfeatures/Complex\ Parallax\ Materials/Shaders/ComplexParallaxMaterials/CRPM.hlsli
instead of...then
split_list_arg()
can be extended to split the whole paths by whitespaces while preserving these filepaths.I've already made modifications to
run-clang-format.py
that should achieve this. I'll have a PR ready in a bit.