Skip to content

Commit

Permalink
pw_toolchain: Quote arguments to --skip-include-path
Browse files Browse the repository at this point in the history
Since these can be regexes, and thus include "*", they need to be quoted
so that they do not undergo shell expansion between the gn and python.

Change-Id: I317019fa05d0bb5a05a27ddbd8b8dbf157ac4ab4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/92643
Reviewed-by: Ted Pudlik <[email protected]>
Commit-Queue: Scott James Remnant <[email protected]>
  • Loading branch information
keybuk authored and CQ Bot Account committed Apr 27, 2022
1 parent b30160f commit 982018f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion pw_toolchain/py/pw_toolchain/clang_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def _parse_args() -> argparse.Namespace:
parser.add_argument(
'--skip-include-path',
default=[],
nargs='*',
action='append',
type=str,
help=('Exclude include paths ending in these paths from clang-tidy. '
'These paths are switched from -I to -isystem so clang-tidy '
'ignores them.'))
Expand Down
9 changes: 5 additions & 4 deletions pw_toolchain/static_analysis_toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ template("pw_static_analysis_toolchain") {
foreach(pattern, pw_toolchain_STATIC_ANALYSIS_SKIP_SOURCES_RES) {
_source_exclude = _source_exclude + " --source-exclude '${pattern}'"
}

_skip_include_path =
"--skip-include-path " +
string_join(" ", pw_toolchain_STATIC_ANALYSIS_SKIP_INCLUDE_PATHS)
_skip_include_path = ""
foreach(pattern, pw_toolchain_STATIC_ANALYSIS_SKIP_INCLUDE_PATHS) {
_skip_include_path =
_skip_include_path + " --skip-include-path '${pattern}'"
}

toolchain(target_name) {
# Uncomment this line to see which toolchains generate other toolchains.
Expand Down

0 comments on commit 982018f

Please sign in to comment.