@@ -280,15 +280,23 @@ def get_ignore_options(comments: dict) -> [bool, list]:
280280 ignore_all = True
281281 else :
282282 command = command .lstrip ("ignore" ).strip ()
283- name , version = command .split ("@" )
284- data = f"{ name } , { version } "
283+ name , version = command .rsplit ("@" , 1 )
284+ ecosystem , name = name .split ("/" , 1 )
285+ data = (ecosystem , name , version )
285286 ignore_commands .append (data )
286287 return ignore_all , ignore_commands
287288
288289 @staticmethod
289- def is_ignore (pkg_name : str , pkg_version : str , name : str , version : str ) -> bool :
290+ def is_ignore (
291+ pkg_ecosystem : str ,
292+ pkg_name : str ,
293+ pkg_version : str ,
294+ ecosystem : str ,
295+ name : str ,
296+ version : str
297+ ) -> bool :
290298 result = False
291- if pkg_name == name and (pkg_version == version or version == "*" ):
299+ if pkg_ecosystem == ecosystem and pkg_name == name and (pkg_version == version or version == "*" ):
292300 result = True
293301 return result
294302
@@ -317,13 +325,13 @@ def process_security_comment(comment: GithubComment, comments) -> str:
317325 if "start-socket-alerts-table" in line :
318326 start = True
319327 elif start and "end-socket-alerts-table" not in line and not Github .is_heading_line (line ) and line != '' :
320- title , package , introduced_by , manifest = line .lstrip ( "|" ). rstrip ("|" ).split ("|" )
328+ title , package , introduced_by , manifest = line .strip ("|" ).split ("|" )
321329 details , _ = package .split ("](" )
322- ecosystem , details = details .split ("/" , 1 )
330+ pkg_ecosystem , details = details . strip ( "[" ) .split ("/" , 1 )
323331 pkg_name , pkg_version = details .split ("@" )
324332 ignore = False
325- for name , version in ignore_commands :
326- if ignore_all or Github .is_ignore (pkg_name , pkg_version , name , version ):
333+ for ecosystem , name , version in ignore_commands :
334+ if ignore_all or Github .is_ignore (pkg_ecosystem , pkg_name , pkg_version , ecosystem , name , version ):
327335 ignore = True
328336 if not ignore :
329337 lines .append (line )
0 commit comments