Skip to content

Commit 4f7f752

Browse files
committed
CM-53944-Fixed issue when docker file is ignored because it has no extension
1 parent 678ae05 commit 4f7f752

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

cycode/cli/files_collector/file_excluder.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,9 @@ def apply_scan_config(self, scan_type: str, scan_config: 'models.ScanConfigurati
6969
if scan_config.scannable_extensions:
7070
self._scannable_extensions[scan_type] = tuple(scan_config.scannable_extensions)
7171

72-
@staticmethod
73-
def check_if_docker_file(file_path: str) -> bool:
74-
path = Path(file_path)
75-
file = path.name
76-
if file == consts.DOCKER_FILE_NAME:
77-
return True
78-
7972
def _is_file_extension_supported(self, scan_type: str, filename: str) -> bool:
8073
filename = filename.lower()
81-
if self.check_if_docker_file(filename):
82-
return True
74+
8375
scannable_extensions = self._scannable_extensions.get(scan_type)
8476
if scannable_extensions:
8577
return filename.endswith(scannable_extensions)
@@ -108,7 +100,8 @@ def _is_relevant_file_to_scan_common(self, scan_type: str, filename: str) -> boo
108100
)
109101
return False
110102

111-
if not self._is_file_extension_supported(scan_type, filename):
103+
# We don't want to check for IAC scans, the extension is handled internally
104+
if not scan_type == consts.IAC_SCAN_TYPE and not self._is_file_extension_supported(scan_type, filename):
112105
logger.debug(
113106
'The document is irrelevant because its extension is not supported, %s',
114107
{'scan_type': scan_type, 'filename': filename},

0 commit comments

Comments
 (0)