File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 3030from matchcode_toolkit .fingerprinting import get_file_fingerprint_hashes
3131from matchcode_toolkit .fingerprinting import get_line_by_pos
3232from matchcode_toolkit .fingerprinting import get_stemmed_file_fingerprint_hashes
33+ from matchcode_toolkit .stemming import TS_LANGUAGE_CONF
3334from scancode import Scanner
3435
3536from scanpipe .pipes import codebase
@@ -285,7 +286,9 @@ def fingerprint_stemmed_codebase_resources(
285286 """
286287 # Checking for None to make the distinction with an empty resource_qs queryset
287288 if resource_qs is None :
288- resource_qs = project .codebaseresources .filter (is_text = True )
289+ resource_qs = project .codebaseresources .filter (
290+ programming_language__in = TS_LANGUAGE_CONF .keys ()
291+ )
289292
290293 if to_codebase_only :
291294 resource_qs = resource_qs .to_codebase ()
Original file line number Diff line number Diff line change @@ -399,7 +399,10 @@ def test_scanpipe_pipes_matchcode_fingerprint_stemmed_codebase_resources(self):
399399 self .project1 .codebase_path ,
400400 )
401401 codebase_resource3 = CodebaseResource .objects .create (
402- project = self .project1 , path = "inherits.js" , is_text = True
402+ project = self .project1 ,
403+ path = "inherits.js" ,
404+ is_text = True ,
405+ programming_language = "JavaScript" ,
403406 )
404407
405408 matchcode .fingerprint_stemmed_codebase_resources (self .project1 )
You can’t perform that action at this time.
0 commit comments