mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
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:
@@ -0,0 +1 @@
|
||||
| 38 |
|
||||
1
python/ql/test/3/query-tests/Summary/LinesOfCode.qlref
Normal file
1
python/ql/test/3/query-tests/Summary/LinesOfCode.qlref
Normal file
@@ -0,0 +1 @@
|
||||
Summary/LinesOfCode.ql
|
||||
@@ -0,0 +1 @@
|
||||
| 11 |
|
||||
@@ -0,0 +1 @@
|
||||
Summary/LinesOfUserCode.ql
|
||||
7
python/ql/test/3/query-tests/Summary/also_python_code
Executable file
7
python/ql/test/3/query-tests/Summary/also_python_code
Executable 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")
|
||||
26
python/ql/test/3/query-tests/Summary/my_file.py
Normal file
26
python/ql/test/3/query-tests/Summary/my_file.py
Normal 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
|
||||
5
python/ql/test/3/query-tests/Summary/not_python
Executable file
5
python/ql/test/3/query-tests/Summary/not_python
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Although this is valid python code, it should not be counted as such.
|
||||
|
||||
print("foo")
|
||||
@@ -1 +0,0 @@
|
||||
semmle-extractor-options: --max-import-depth=1 --lang=3
|
||||
Reference in New Issue
Block a user