Skip to content

Commit

Permalink
codeql-go merge prep: integrate go/ into codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
cklin committed May 20, 2022
1 parent 097d518 commit 1276c41
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 116 deletions.
2 changes: 2 additions & 0 deletions .codeqlmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"*/ql/examples/qlpack.yml",
"*/ql/consistency-queries/qlpack.yml",
"cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml",
"go/ql/config/legacy-support/qlpack.yml",
"go/build/codeql-extractor-go/codeql-extractor.yml",
"javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml",
"javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/qlpack.yml",
"javascript/ql/experimental/adaptivethreatmodeling/src/qlpack.yml",
Expand Down
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*.py text
*.lua text
*.expected text
*.go text

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

# Force git not to modify line endings for go or html files under the go/ql directory
go/ql/**/*.go -text
go/ql/**/*.html -text
# Force git not to modify line endings for go dbschemes
go/*.dbscheme -text
# Preserve unusual line ending from codeql-go merge
go/extractor/opencsv/CSVReader.java -text

# For some languages, upgrade script testing references really old dbscheme
# files from legacy upgrades that have CRLF line endings. Since upgrade
# resolution relies on object hashes, we must suppress line ending conversion
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CodeQL tests
name: "Go: Run Tests"
on: [pull_request]
jobs:

Expand Down Expand Up @@ -38,22 +38,30 @@ jobs:
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'

- name: Build
run: env PATH=$PATH:$HOME/codeql make
run: |
cd go
env PATH=$PATH:$HOME/codeql make
- name: Check that all QL and Go code is autoformatted
run: env PATH=$PATH:$HOME/codeql make check-formatting
run: |
cd go
env PATH=$PATH:$HOME/codeql make check-formatting
- name: Compile qhelp files to markdown
run: env PATH=$PATH:$HOME/codeql QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown
run: |
cd go
env PATH=$PATH:$HOME/codeql QHELP_OUT_DIR=qhelp-out make qhelp-to-markdown
- name: Upload qhelp markdown
uses: actions/upload-artifact@v2
with:
name: qhelp-markdown
path: qhelp-out/**/*.md
path: go/qhelp-out/**/*.md

- name: Test
run: env PATH=$PATH:$HOME/codeql make test
run: |
cd go
env PATH=$PATH:$HOME/codeql make test
test-mac:
name: Test MacOS
Expand Down Expand Up @@ -90,10 +98,14 @@ jobs:
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'

- name: Build
run: env PATH=$PATH:$HOME/codeql make
run: |
cd go
env PATH=$PATH:$HOME/codeql make
- name: Test
run: env PATH=$PATH:$HOME/codeql make test
run: |
cd go
env PATH=$PATH:$HOME/codeql make test
test-win:
name: Test Windows
Expand Down Expand Up @@ -135,9 +147,11 @@ jobs:
- name: Build
run: |
$Env:Path += ";$HOME\codeql"
cd go
make
- name: Test
run: |
$Env:Path += ";$HOME\codeql"
cd go
make test
2 changes: 1 addition & 1 deletion .github/workflows/ql-for-ql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
folder: [cpp, csharp, java, javascript, python, ql, ruby, swift]
folder: [cpp, csharp, java, javascript, python, ql, ruby, swift, go]

needs:
- package
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# qltest projects and artifacts
*/ql/test/**/*.testproj
*/ql/test/**/*.actual
*/ql/test/**/go.sum

# Visual studio temporaries, except a file used by QL4VS
.vs/*
Expand Down Expand Up @@ -42,3 +43,15 @@ csharp/extractor/Semmle.Extraction.CSharp.Driver/Properties/launchSettings.json

# CLion project files
/.clwb

# Go build artifacts
go/build/*

# Go binaries
go/tools/bin
go/tools/linux64
go/tools/osx64
go/tools/win64
go/tools/tokenizer.jar
go/main

4 changes: 4 additions & 0 deletions .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ path_classifiers:
test:
- csharp/ql/src
- csharp/ql/test
- go/ql/test
- javascript/extractor/parser-tests
- javascript/extractor/tests
- javascript/ql/src
- javascript/ql/test
- python/ql/src
- python/ql/test

example:
- go/ql/src

queries:
- include: "*"

Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/cpp/ @github/codeql-c-analysis
/csharp/ @github/codeql-csharp
/go/ @github/codeql-go
/java/ @github/codeql-java
/javascript/ @github/codeql-javascript
/python/ @github/codeql-python
Expand Down
20 changes: 0 additions & 20 deletions go/.codeqlmanifest.json

This file was deleted.

10 changes: 0 additions & 10 deletions go/.devcontainer/devcontainer.json

This file was deleted.

6 changes: 0 additions & 6 deletions go/.gitattributes

This file was deleted.

4 changes: 0 additions & 4 deletions go/.github/codeql/codeql-config.yml

This file was deleted.

33 changes: 0 additions & 33 deletions go/.github/workflows/check-change-note.yml

This file was deleted.

28 changes: 0 additions & 28 deletions go/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions go/.lgtm.yml

This file was deleted.

1 change: 0 additions & 1 deletion go/CODEOWNERS

This file was deleted.

0 comments on commit 1276c41

Please sign in to comment.