mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Add ClassifyFiles.ql
This commit is contained in:
20
ql/src/filters/ClassifyFiles.ql
Normal file
20
ql/src/filters/ClassifyFiles.ql
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @name Classify files
|
||||
* @description This query produces a list of all files in a database
|
||||
* that are classified as generated code or test code.
|
||||
*
|
||||
* Used by LGTM.
|
||||
* @kind file-classifier
|
||||
* @id rb/file-classifier
|
||||
*/
|
||||
|
||||
import ruby
|
||||
import codeql.ruby.filters.GeneratedCode
|
||||
|
||||
predicate classify(File f, string category) {
|
||||
f instanceof GeneratedCodeFile and category = "generated"
|
||||
}
|
||||
|
||||
from File f, string category
|
||||
where classify(f, category)
|
||||
select f, category
|
||||
Reference in New Issue
Block a user