Python: options file was not enough, split into 2/3

I reckon this is due to the Python 3 version used by the Python 2 tests
is different from 3.12, so even with --lang=3 the tests are still using
an incompatible version :(
This commit is contained in:
Rasmus Wriedt Larsen
2023-11-15 14:24:11 +01:00
parent 0f1dc9b2d9
commit e02c32f3d4
15 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1 @@
| 38 |

View File

@@ -0,0 +1 @@
Summary/LinesOfCode.ql

View File

@@ -0,0 +1 @@
| 11 |

View File

@@ -0,0 +1 @@
Summary/LinesOfUserCode.ql

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env python
# although this is actually Python code, it is not included by the extractor by default.
print("this is also code")
print("but just dummy code")

View File

@@ -0,0 +1,26 @@
"""
module level docstring
is not included
"""
# this line is not code
# `tty` was chosen for stability over python versions (so we don't get diffrent results
# on different computers, that has different versions of Python).
#
# According to https://github.com/python/cpython/tree/master/Lib (at 2021-04-23) `tty`
# was last changed in 2001, so chances of this being changed in the future are slim.
import tty
s = """
all these lines are code
"""
print(s)
def func():
"""
this string is a doc-string. Although the module-level docstring is not considered
code, this one apparently is ¯\_(ツ)_/¯
"""
pass

View File

@@ -0,0 +1,5 @@
#!/bin/bash
# Although this is valid python code, it should not be counted as such.
print("foo")

View File

@@ -1 +0,0 @@
semmle-extractor-options: --max-import-depth=1 --lang=3