File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11# SPDX-License-Identifier: Apache-2.0
22# Standard
3+ from pathlib import Path
34import hashlib
45import json
56import os
2223def get_file_paths (directory ):
2324 logger .debug (locals ())
2425 file_paths = []
25- for root , _ , files in os .walk (directory ):
26- for file in files :
27- if file .split ("/" )[- 1 ] == "qna.yaml" :
28- file_paths .append (os .path .join (root , file ))
26+ root_paths = [
27+ entry
28+ for entry in Path (directory ).iterdir ()
29+ if entry .is_dir ()
30+ if not entry .name .startswith ("." )
31+ if entry .name != "knowledge"
32+ if entry .name != "docs"
33+ if entry .name != "scripts"
34+ ]
35+ for basedir in root_paths :
36+ for root , _ , files in os .walk (basedir ):
37+ file_paths .extend (
38+ [os .path .join (root , file ) for file in files if file == "qna.yaml" ]
39+ )
2940 return file_paths
3041
3142
You can’t perform that action at this time.
0 commit comments