Total Complexity | 3 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import fnmatch |
||
2 | |||
3 | |||
4 | def is_path_to_be_ignored(event_path, report_path, ignore_patterns): |
||
5 | """ |
||
6 | answers: Is event_path one among the ignore_patterns? |
||
7 | strips report path from the event_path |
||
8 | :param event_path: str |
||
9 | :param report_path: str |
||
10 | :param ignore_patterns: list |
||
11 | :return: bool |
||
12 | """ |
||
13 | for ignored_pattern in ignore_patterns: |
||
14 | _, current_file_path = event_path.split(report_path + '/') |
||
15 | if fnmatch.fnmatch(current_file_path, ignored_pattern): |
||
16 | return True |
||
17 | return False |
||
18 |