MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / check_is_community_file

Function check_is_community_file

src/summarycode/classify.py:118–134  ·  view source on GitHub ↗

Return True if the resource is a known community filename, return False otherwise.

(filename)

Source from the content-addressed store, hash-verified

116
117
118def check_is_community_file(filename):
119 """
120 Return True if the resource is a known community filename,
121 return False otherwise.
122 """
123 community_files_cleaned = [
124 clean_underscore_dash(filename.lower())
125 for filename in COMMUNITY_FILES
126 ]
127 name = clean_underscore_dash(filename.lower())
128 if any(
129 name.startswith(comm_name) or name.endswith(comm_name)
130 for comm_name in community_files_cleaned
131 ):
132 return True
133
134 return False
135
136
137def check_is_resource_community_file(resource):

Callers 2

Calls 1

clean_underscore_dashFunction · 0.85

Tested by

no test coverage detected