Skip to content

Commit

Permalink
Add multi-language-repo
Browse files Browse the repository at this point in the history
  • Loading branch information
David Verdeguer committed May 8, 2020
1 parent b73b259 commit 583f8a9
Show file tree
Hide file tree
Showing 32 changed files with 257 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/multi-language-repo/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class Main {
public static void main(String args[]) {
if (true) {
System.out.println("Hello, World!");
}
}
}

8 changes: 8 additions & 0 deletions tests/multi-language-repo/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

gcc -o main main.c

dotnet build

javac Main.java

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Foo Show Ifs
* @description Foo Show Ifs
* @kind problem
* @id complex-javascript-querypack/foo-show-ifs
*/

import javascript

from IfStmt i
select i, "foo if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Bar Show Ifs
* @description Bar Show Ifs
* @kind problem
* @id complex-javascript-querypack/bar-ifs
*/

import javascript

from IfStmt i
select i, "bar if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Barfoobar Show Ifs
* @description Barfoobar Show Ifs
* @kind problem
* @id complex-javascript-querypack/barfoobar-ifs
*/

import javascript

from IfStmt i
select i, "barfoobar if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Foo2 Show Ifs
* @description Foo2 Show Ifs
* @kind problem
* @id complex-javascript-querypack/foo2-ifs
*/

import javascript

from IfStmt i
select i, "foo2 if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: complex-javascript-querypack
version: 0.0.1
libraryPathDependencies: codeql-javascript
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Root Show Ifs
* @description Root Show Ifs
* @kind problem
* @id complex-javascript-querypack/root-show-ifs
*/

import javascript

from IfStmt i
select i, "root if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Foo/Bar Show Ifs
* @description Foo/Bar Show Ifs
* @kind problem
* @id complex-python-querypack/foo/bar/show-ifs
*/

import python

from If i
select i, "foo/bar if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Foo Show Ifs
* @description Foo Show Ifs
* @kind problem
* @id complex-python-querypack/foo/show-ifs
*/

import python

from If i
select i, "foo if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-python-querypack
version: 0.0.1
libraryPathDependencies: codeql-python
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- query: show_ifs.ql
- query: foo/bar/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Ifs
* @description Show Ifs
* @kind problem
* @id complex-python-querypack/show-ifs
*/

import python

from If i
select i, "hello if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-cpp-querypack
version: 0.0.1
libraryPathDependencies: codeql-cpp
11 changes: 11 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/cpp-qlpack/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Cpp Ifs
* @description Show Cpp Ifs
* @kind problem
* @id inrepo-cpp-querypack/show-ifs
*/

import cpp

from IfStmt i
select i, "hello if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-csharp-querypack
version: 0.0.1
libraryPathDependencies: codeql-csharp
11 changes: 11 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/csharp-qlpack/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Csharp Ifs
* @description Show Csharp Ifs
* @kind problem
* @id inrepo-csharp-querypack/show-ifs
*/

import csharp

from IfStmt i
select i, "hello if"
3 changes: 3 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/go-qlpack/qlpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-go-querypack
version: 0.0.1
libraryPathDependencies: codeql-go
11 changes: 11 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/go-qlpack/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Go Ifs
* @description Show Go Ifs
* @kind problem
* @id inrepo-go-querypack/show-ifs
*/

import go

from IfStmt i
select i, "hello if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-java-querypack
version: 0.0.1
libraryPathDependencies: codeql-java
11 changes: 11 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/java-qlpack/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Java Ifs
* @description Show Java Ifs
* @kind problem
* @id inrepo-java-querypack/show-ifs
*/

import java

from IfStmt i
select i, "hello if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-javascript-querypack
version: 0.0.1
libraryPathDependencies: codeql-javascript
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Javascript Ifs
* @description Show Javascript Ifs
* @kind problem
* @id inrepo-javascript-querypack/show-ifs
*/

import javascript

from IfStmt i
select i, "hello if"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: inrepo-python-querypack
version: 0.0.1
libraryPathDependencies: codeql-python
11 changes: 11 additions & 0 deletions tests/multi-language-repo/codeql-qlpacks/python-qlpack/show_ifs.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* @name Show Python Ifs
* @description Show Python Ifs
* @kind problem
* @id inrepo-python-querypack/show-ifs
*/

import python

from If i
select i, "hello if"
9 changes: 9 additions & 0 deletions tests/multi-language-repo/csharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>multi_language_test</RootNamespace>
</PropertyGroup>

</Project>
8 changes: 8 additions & 0 deletions tests/multi-language-repo/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "stdio.h"

int main(int argc, char **argv) {
if (1) {
printf("Hello, World!\n");
}
}

12 changes: 12 additions & 0 deletions tests/multi-language-repo/main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace HelloWorldApp {
class Geeks {
static void Main(string[] args) {
if (true) {
Console.WriteLine("Hello World!");
}
}
}
}

9 changes: 9 additions & 0 deletions tests/multi-language-repo/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import "fmt"

func main() {
if true {
fmt.Println("hello world")
}
}
3 changes: 3 additions & 0 deletions tests/multi-language-repo/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if (true) {
console.log("Hello, World!");
}
9 changes: 9 additions & 0 deletions tests/multi-language-repo/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/python3

def main():
if True:
print("Hello, World!")

if __name__ == '__main__':
main()

11 changes: 11 additions & 0 deletions tests/multi-language-repo/main.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/ruby
# frozen_string_literal: true

def main
v = ARGV[0]

puts 'with arg?' unless v.nil?
puts 'hello there'
end

main

0 comments on commit 583f8a9

Please sign in to comment.