I need support to exclude some files from directory for clang operation in yaml with ansible with zuul jobs.
purpose: I need to exclude unwanted files (e.g. exclude 4 / 10 files) from directory to perform clang operation in zuul jobs which is written in yaml with ansbile as below example:
I need help to correct this if there is any syntax issue / any other minor mistakes.
- job:
name: clang-component1
parent: base-clang-tools
required-projects:
- name: apps-project
vars:
app_name: component1
repo_root: “{{ zuul.projects[‘url/apps-project’].src_dir }}”
workspace: “{{ repo_root }}/inside1/component1”
filtered_cpp_files: >-
{{
src_cpp_files.files | # something is missed?
selectattr(‘path’, ‘search’, ‘^(?!.(file1.cpp|file2.cpp|file3.cpp))..cpp$’) |
map(attribute=‘path’) |
list
}}
filtered_hpp_files: >-
{{
src_cpp_files.files | # something is missed?
selectattr(‘path’, ‘search’, ‘^(?!.(file1.hpp|file2.hpp|file3.hpp))..hpp$’) |
map(attribute=‘path’) |
list
}}
additionalsourcefiles: >-
{{
‘dir1/src/*.hpp’,
'dir1/inc/*.cpp’,
‘dir1/inc/*.hpp’
}}
runclangfiles: >-
{{
filtered_cpp_files + filtered_hpp_files + additionalsourcefiles
}}
analysis_code_paths: “{{ runclangfiles }}”
Thank you in advance!