Skip to content

Commit f38d1f9

Browse files
authored
merge main into ts47
2 parents 2da001e + 67572bb commit f38d1f9

File tree

2,756 files changed

+256690
-4133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,756 files changed

+256690
-4133
lines changed

.codeqlmanifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"*/ql/examples/qlpack.yml",
77
"*/ql/consistency-queries/qlpack.yml",
88
"cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml",
9+
"go/ql/config/legacy-support/qlpack.yml",
10+
"go/build/codeql-extractor-go/codeql-extractor.yml",
911
"javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml",
1012
"javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/qlpack.yml",
1113
"javascript/ql/experimental/adaptivethreatmodeling/src/qlpack.yml",
@@ -15,6 +17,7 @@
1517
"misc/legacy-support/*/qlpack.yml",
1618
"misc/suite-helpers/qlpack.yml",
1719
"ruby/extractor-pack/codeql-extractor.yml",
20+
"swift/extractor-pack/codeql-extractor.yml",
1821
"ql/extractor-pack/codeql-extractor.yml"
1922
],
2023
"versionPolicies": {

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
*.py text
4040
*.lua text
4141
*.expected text
42+
*.go text
4243

4344
# Explicitly set a bunch of known extensions to binary, because Git < 2.10 will treat
4445
# `* text=auto eol=lf` as `* text eol=lf`
@@ -52,6 +53,14 @@
5253
java/ql/test/stubs/**/*.java linguist-generated=true
5354
java/ql/test/experimental/stubs/**/*.java linguist-generated=true
5455

56+
# Force git not to modify line endings for go or html files under the go/ql directory
57+
go/ql/**/*.go -text
58+
go/ql/**/*.html -text
59+
# Force git not to modify line endings for go dbschemes
60+
go/*.dbscheme -text
61+
# Preserve unusual line ending from codeql-go merge
62+
go/extractor/opencsv/CSVReader.java -text
63+
5564
# For some languages, upgrade script testing references really old dbscheme
5665
# files from legacy upgrades that have CRLF line endings. Since upgrade
5766
# resolution relies on object hashes, we must suppress line ending conversion
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "codeql-query-format",
5+
"pattern": [
6+
{
7+
"regexp": "^((.*) would change by autoformatting\\.)$",
8+
"file": 2,
9+
"message": 1
10+
}
11+
]
12+
}
13+
]
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "codeql-syntax-check",
5+
"pattern": [
6+
{
7+
"regexp": "^((ERROR|WARNING): .* \\((.*):(\\d+),(\\d+)-\\d+\\))$",
8+
"message": 1,
9+
"file": 3,
10+
"line": 4,
11+
"col": 5,
12+
"severity": 2
13+
}
14+
]
15+
}
16+
]
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "codeql-test-run",
5+
"pattern": [
6+
{
7+
"regexp": "(\\[.*\\] FAILED\\((RESULT|COMPILATION)\\) (.*))$",
8+
"file": 3,
9+
"message": 1
10+
}
11+
]
12+
}
13+
]
14+
}

.github/problem-matchers/make.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "make",
5+
"pattern": [
6+
{
7+
"regexp": "^(make: \\*\\*\\* .*)$",
8+
"message": 1
9+
}
10+
]
11+
}
12+
]
13+
}

.github/workflows/go-tests.yml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: "Go: Run Tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- "go/**"
6+
- .github/workflows/go-tests.yml
7+
jobs:
8+
9+
test-linux:
10+
name: Test Linux (Ubuntu)
11+
runs-on: ubuntu-latest
12+
steps:
13+
14+
- name: Set up Go 1.18.1
15+
uses: actions/setup-go@v3
16+
with:
17+
go-version: 1.18.1
18+
id: go
19+
20+
- name: Set up CodeQL CLI
21+
run: |
22+
echo "Removing old CodeQL Directory..."
23+
rm -rf $HOME/codeql
24+
echo "Done"
25+
cd $HOME
26+
echo "Downloading CodeQL CLI..."
27+
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | grep -v beta | tail -1)
28+
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
29+
echo "Done"
30+
echo "Unpacking CodeQL CLI..."
31+
unzip -q codeql-linux64.zip
32+
rm -f codeql-linux64.zip
33+
echo "Done"
34+
env:
35+
GITHUB_TOKEN: ${{ github.token }}
36+
37+
- name: Check out code
38+
uses: actions/checkout@v2
39+
40+
- name: Enable problem matchers in repository
41+
shell: bash
42+
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
43+
44+
- name: Build
45+
run: |
46+
cd go
47+
env PATH=$PATH:$HOME/codeql make
48+
49+
- name: Check that all QL and Go code is autoformatted
50+
run: |
51+
cd go
52+
env PATH=$PATH:$HOME/codeql make check-formatting
53+
54+
- name: Compile qhelp files to markdown
55+
run: |
56+
cd go
57+
env PATH=$PATH:$HOME/codeql QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown
58+
59+
- name: Upload qhelp markdown
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: qhelp-markdown
63+
path: go/qhelp-out/**/*.md
64+
65+
- name: Test
66+
run: |
67+
cd go
68+
env PATH=$PATH:$HOME/codeql make test
69+
70+
test-mac:
71+
name: Test MacOS
72+
runs-on: macOS-latest
73+
steps:
74+
- name: Set up Go 1.18.1
75+
uses: actions/setup-go@v3
76+
with:
77+
go-version: 1.18.1
78+
id: go
79+
80+
- name: Set up CodeQL CLI
81+
run: |
82+
echo "Removing old CodeQL Directory..."
83+
rm -rf $HOME/codeql
84+
echo "Done"
85+
cd $HOME
86+
echo "Downloading CodeQL CLI..."
87+
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | grep -v beta | tail -1)
88+
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-osx64.zip "$LATEST"
89+
echo "Done"
90+
echo "Unpacking CodeQL CLI..."
91+
unzip -q codeql-osx64.zip
92+
rm -f codeql-osx64.zip
93+
echo "Done"
94+
env:
95+
GITHUB_TOKEN: ${{ github.token }}
96+
97+
- name: Check out code
98+
uses: actions/checkout@v2
99+
100+
- name: Enable problem matchers in repository
101+
shell: bash
102+
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
103+
104+
- name: Build
105+
run: |
106+
cd go
107+
env PATH=$PATH:$HOME/codeql make
108+
109+
- name: Test
110+
run: |
111+
cd go
112+
env PATH=$PATH:$HOME/codeql make test
113+
114+
test-win:
115+
name: Test Windows
116+
runs-on: windows-2019
117+
steps:
118+
- name: Set up Go 1.18.1
119+
uses: actions/setup-go@v3
120+
with:
121+
go-version: 1.18.1
122+
id: go
123+
124+
- name: Set up CodeQL CLI
125+
run: |
126+
echo "Removing old CodeQL Directory..."
127+
rm -rf $HOME/codeql
128+
echo "Done"
129+
cd "$HOME"
130+
echo "Downloading CodeQL CLI..."
131+
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | sort --version-sort | grep -v beta | tail -1)
132+
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-win64.zip "$LATEST"
133+
echo "Done"
134+
echo "Unpacking CodeQL CLI..."
135+
unzip -q -o codeql-win64.zip
136+
unzip -q -o codeql-win64.zip codeql/codeql.exe
137+
rm -f codeql-win64.zip
138+
echo "Done"
139+
env:
140+
GITHUB_TOKEN: ${{ github.token }}
141+
shell:
142+
bash
143+
144+
- name: Check out code
145+
uses: actions/checkout@v2
146+
147+
- name: Enable problem matchers in repository
148+
shell: bash
149+
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
150+
151+
- name: Build
152+
run: |
153+
$Env:Path += ";$HOME\codeql"
154+
cd go
155+
make
156+
157+
- name: Test
158+
run: |
159+
$Env:Path += ";$HOME\codeql"
160+
cd go
161+
make test

.github/workflows/ql-for-ql-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
runs-on: ubuntu-latest
141141
strategy:
142142
matrix:
143-
folder: [cpp, csharp, java, javascript, python, ql, ruby, swift]
143+
folder: [cpp, csharp, java, javascript, python, ql, ruby, swift, go]
144144

145145
needs:
146146
- package

.github/workflows/ql-for-ql-dataset_measure.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
matrix:
2020
repo:
2121
- github/codeql
22-
- github/codeql-go
2322
runs-on: ubuntu-latest
2423
steps:
2524
- uses: actions/checkout@v3
@@ -77,7 +76,7 @@ jobs:
7776
path: stats
7877
- run: |
7978
python -m pip install --user lxml
80-
find stats -name 'stats.xml' -print0 | sort -z | xargs -0 python ql/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
79+
find stats -name 'stats.xml' -print0 | sort -z | xargs -0 python ruby/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
8180
- uses: actions/upload-artifact@v3
8281
with:
8382
name: ql.dbscheme.stats

.github/workflows/query-list.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
uses: actions/checkout@v3
2121
with:
2222
path: codeql
23-
- name: Clone github/codeql-go
24-
uses: actions/checkout@v3
25-
with:
26-
repository: 'github/codeql-go'
27-
path: codeql-go
2823
- name: Set up Python 3.8
2924
uses: actions/setup-python@v3
3025
with:

0 commit comments

Comments
 (0)