Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Y.Hisaki <[email protected]>
  • Loading branch information
yhisaki committed Nov 28, 2024
1 parent 6a35795 commit 58e377c
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions clang-tidy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
target-packages:
description: ""
required: true
target-files:
description: ""
required: false
build-depends-repos:
description: ""
required: false
Expand Down Expand Up @@ -103,18 +106,21 @@ runs:
- name: Get target files
id: get-target-files
run: |
read -ra target_packages <<< "${{ inputs.target-packages }}"
mapfile -t package_paths < <(colcon list --paths-only --packages-select "${target_packages[@]}")
ignore_patterns=()
ignore_patterns+=( -not -path "*/test/*" )
if [ -f .clang-tidy-ignore ]; then
while IFS= read -r pattern; do
ignore_patterns+=( -not -path "$pattern" )
done < .clang-tidy-ignore
fi
target_files=$(find "${package_paths[@]}" -type f \( -name '*.cpp' \) "${ignore_patterns[@]}" | tr '\n' ' ')
echo "target-files=$target_files"
echo "target-files=$target_files" >> $GITHUB_OUTPUT
if [ "${{ inputs.target-files }}" != "" ]; then
target_files="${{ inputs.target-files }}"
else
read -ra target_packages <<< "${{ inputs.target-packages }}"
mapfile -t package_paths < <(colcon list --paths-only --packages-select "${target_packages[@]}")
ignore_patterns=()
ignore_patterns+=( -not -path "*/test/*" )
if [ -f .clang-tidy-ignore ]; then
while IFS= read -r pattern; do
ignore_patterns+=( -not -path "$pattern" )
done < .clang-tidy-ignore
fi
target_files=$(find "${package_paths[@]}" -name '*.cpp' "${ignore_patterns[@]}" | tr '\n' ' ')
echo "target-files=$target_files"
echo "target-files=$target_files" >> $GITHUB_OUTPUT
shell: bash

- name: Analyze
Expand Down

0 comments on commit 58e377c

Please sign in to comment.