Compare commits

...

8 Commits

Author SHA1 Message Date
Erik Krogh Kristensen
0dd6eef202 more command line shenanigans 2022-06-17 08:20:56 +00:00
Erik Krogh Kristensen
4d726bc295 avoid glob stuff 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
4367f8e3ff use relative paths in the autobuilders 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
eced887a8e windows fix attempt 2 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
f33bd2fecc attempt to fix Windows 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
c28107bce3 get excludes to work properly 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
16c5c7dfd7 remove tools:latest from codeql-action in QL-for-QL 2022-06-17 08:06:59 +00:00
Erik Krogh Kristensen
0cac40a5e3 update, and fix, the autobuilders by using the new --also-match option 2022-06-17 08:06:59 +00:00
3 changed files with 8 additions and 14 deletions

View File

@@ -187,7 +187,6 @@ jobs:
languages: ql languages: ql
db-location: ${{ runner.temp }}/db db-location: ${{ runner.temp }}/db
config-file: ./ql-for-ql-config.yml config-file: ./ql-for-ql-config.yml
tools: latest
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980 uses: github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980
@@ -200,4 +199,3 @@ jobs:
with: with:
name: ${{ matrix.folder }}.sarif name: ${{ matrix.folder }}.sarif
path: ${{ matrix.folder }}.sarif path: ${{ matrix.folder }}.sarif

View File

@@ -15,29 +15,25 @@ fn main() -> std::io::Result<()> {
let mut cmd = Command::new(codeql); let mut cmd = Command::new(codeql);
cmd.arg("database") cmd.arg("database")
.arg("index-files") .arg("index-files")
.arg("--include-extension=.ql")
.arg("--include-extension=.qll")
.arg("--include-extension=.dbscheme")
.arg("--include=**/qlpack.yml")
.arg("--size-limit=5m") .arg("--size-limit=5m")
.arg("--language=ql") .arg("--language=ql")
.arg("--working-dir=.") .arg("--working-dir=.")
.arg(db); .arg(db);
let mut has_include_dir = false; // TODO: This is a horrible hack, wait for the post-merge discussion in https://github.com/github/codeql/pull/7444 to be resolved
for line in env::var("LGTM_INDEX_FILTERS") for line in env::var("LGTM_INDEX_FILTERS")
.unwrap_or_default() .unwrap_or_default()
.split('\n') .split('\n')
{ {
if let Some(stripped) = line.strip_prefix("include:") { if let Some(stripped) = line.strip_prefix("include:") {
cmd.arg("--include").arg(stripped); cmd.arg("--also-match=".to_owned() + stripped);
has_include_dir = true;
} else if let Some(stripped) = line.strip_prefix("exclude:") { } else if let Some(stripped) = line.strip_prefix("exclude:") {
cmd.arg("--exclude").arg(stripped); cmd.arg("--exclude=".to_owned() + stripped);
} }
} }
if !has_include_dir {
cmd.arg("--include-extension=.ql")
.arg("--include-extension=.qll")
.arg("--include-extension=.dbscheme")
.arg("--include=**/qlpack.yml");
}
let exit = &cmd.spawn()?.wait()?; let exit = &cmd.spawn()?.wait()?;
std::process::exit(exit.code().unwrap_or(1)) std::process::exit(exit.code().unwrap_or(1))
} }

View File

@@ -29,9 +29,9 @@ fn main() -> std::io::Result<()> {
.split('\n') .split('\n')
{ {
if let Some(stripped) = line.strip_prefix("include:") { if let Some(stripped) = line.strip_prefix("include:") {
cmd.arg("--include").arg(stripped); cmd.arg("--also-match=".to_owned() + stripped);
} else if let Some(stripped) = line.strip_prefix("exclude:") { } else if let Some(stripped) = line.strip_prefix("exclude:") {
cmd.arg("--exclude").arg(stripped); cmd.arg("--exclude=".to_owned() + stripped);
} }
} }
let exit = &cmd.spawn()?.wait()?; let exit = &cmd.spawn()?.wait()?;