File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -15,25 +15,29 @@ fn main() -> std::io::Result<()> {
15
15
let mut cmd = Command :: new ( codeql) ;
16
16
cmd. arg ( "database" )
17
17
. arg ( "index-files" )
18
- . arg ( "--include-extension=.ql" )
19
- . arg ( "--include-extension=.qll" )
20
- . arg ( "--include-extension=.dbscheme" )
21
- . arg ( "--include=**/qlpack.yml" )
22
18
. arg ( "--size-limit=5m" )
23
19
. arg ( "--language=ql" )
24
20
. arg ( "--working-dir=." )
25
21
. arg ( db) ;
26
22
23
+ 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
27
24
for line in env:: var ( "LGTM_INDEX_FILTERS" )
28
25
. unwrap_or_default ( )
29
26
. split ( '\n' )
30
27
{
31
28
if let Some ( stripped) = line. strip_prefix ( "include:" ) {
32
29
cmd. arg ( "--include" ) . arg ( stripped) ;
30
+ has_include_dir = true ;
33
31
} else if let Some ( stripped) = line. strip_prefix ( "exclude:" ) {
34
32
cmd. arg ( "--exclude" ) . arg ( stripped) ;
35
33
}
36
34
}
35
+ if !has_include_dir {
36
+ cmd. arg ( "--include-extension=.ql" )
37
+ . arg ( "--include-extension=.qll" )
38
+ . arg ( "--include-extension=.dbscheme" )
39
+ . arg ( "--include=**/qlpack.yml" ) ;
40
+ }
37
41
let exit = & cmd. spawn ( ) ?. wait ( ) ?;
38
42
std:: process:: exit ( exit. code ( ) . unwrap_or ( 1 ) )
39
43
}
Original file line number Diff line number Diff line change @@ -127,6 +127,15 @@ fn main() -> std::io::Result<()> {
127
127
lines
128
128
. par_iter ( )
129
129
. try_for_each ( |line| {
130
+ // only consider files that end with .ql/.qll/.dbscheme/qlpack.yml
131
+ // TODO: This is a bad fix, wait for the post-merge discussion in https://github.com/github/codeql/pull/7444 to be resolved
132
+ if !line. ends_with ( ".ql" )
133
+ && !line. ends_with ( ".qll" )
134
+ && !line. ends_with ( ".dbscheme" )
135
+ && !line. ends_with ( "qlpack.yml" )
136
+ {
137
+ return Ok ( ( ) ) ;
138
+ }
130
139
let path = PathBuf :: from ( line) . canonicalize ( ) ?;
131
140
let src_archive_file = path_for ( & src_archive_dir, & path, "" ) ;
132
141
let source = std:: fs:: read ( & path) ?;
You can’t perform that action at this time.
0 commit comments