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

Function is_source

src/textcode/analysis.py:351–423  ·  view source on GitHub ↗

Return True if the file at location is source code, based on its file extension

(location)

Source from the content-addressed store, hash-verified

349
350
351def is_source(location):
352 """
353 Return True if the file at location is source code, based on its file
354 extension
355 """
356 return location.endswith((
357 '.ada',
358 '.adb',
359 '.asm',
360 '.asp',
361 '.aj',
362 '.bas',
363 '.bat',
364 '.c',
365 '.c++',
366 '.cc',
367 '.clj',
368 '.cob',
369 '.cpp',
370 '.cs',
371 '.csh',
372 '.csx',
373 '.cxx',
374 '.d',
375 '.e',
376 '.el',
377 '.f',
378 '.fs',
379 '.f77',
380 '.f90',
381 '.for',
382 '.fth',
383 '.ftn',
384 '.go',
385 '.h',
386 '.hh',
387 '.hpp',
388 '.hs',
389 '.html',
390 '.htm',
391 '.hxx',
392 '.java',
393 '.js',
394 '.jsx',
395 '.jsp',
396 '.ksh',
397 '.kt',
398 '.lisp',
399 '.lua',
400 '.m',
401 '.m4',
402 '.nim',
403 '.pas',
404 '.php',
405 '.pl',
406 '.pp',
407 '.ps1',
408 '.py',

Callers 1

numbered_text_linesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected