From 72d2e17c2db135a3a130e0af4a50ae7af89c2d0c Mon Sep 17 00:00:00 2001 From: qwerty250 Date: Sat, 6 Nov 2021 18:20:53 +0800 Subject: [PATCH] Add codeql-custom-queries-ruby --- codeql-custom-queries-ruby/example.ql | 12 ++++++++++++ codeql-custom-queries-ruby/qlpack.yml | 7 +++++++ codeql-custom-queries-ruby/queries.xml | 1 + 3 files changed, 20 insertions(+) create mode 100644 codeql-custom-queries-ruby/example.ql create mode 100644 codeql-custom-queries-ruby/qlpack.yml create mode 100644 codeql-custom-queries-ruby/queries.xml diff --git a/codeql-custom-queries-ruby/example.ql b/codeql-custom-queries-ruby/example.ql new file mode 100644 index 0000000..77eb17f --- /dev/null +++ b/codeql-custom-queries-ruby/example.ql @@ -0,0 +1,12 @@ +/** + * @name Empty block + * @kind problem + * @problem.severity warning + * @id ruby/example/empty-block + */ + +import ruby + +from Block b +where b.getNumberOfStatements()= 0 +select b, "This is an empty block." \ No newline at end of file diff --git a/codeql-custom-queries-ruby/qlpack.yml b/codeql-custom-queries-ruby/qlpack.yml new file mode 100644 index 0000000..6ce3264 --- /dev/null +++ b/codeql-custom-queries-ruby/qlpack.yml @@ -0,0 +1,7 @@ +# Change 'getting-started' to the name of a user or organization that you have write access to. +name: getting-started/codeql-extra-queries-ruby +version: 0.0.0 +dependencies: + # This uses the latest version of the codeql/ruby-all library. + # You may want to change to a more precise semver string. + codeql/ruby-all: "*" \ No newline at end of file diff --git a/codeql-custom-queries-ruby/queries.xml b/codeql-custom-queries-ruby/queries.xml new file mode 100644 index 0000000..0c86c5b --- /dev/null +++ b/codeql-custom-queries-ruby/queries.xml @@ -0,0 +1 @@ + \ No newline at end of file