mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Add test for unexpected directory layout error
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"markdownMessage": "You should replace relative package paths (that contain `.` or `..`) with absolute paths. Alternatively you can [use a Go module](https://go.dev/blog/using-go-modules).",
|
||||
"severity": "error",
|
||||
"source": {
|
||||
"extractorName": "go",
|
||||
"id": "go/autobuilder/relative-import-paths",
|
||||
"name": "Some imports use unsupported relative package paths"
|
||||
},
|
||||
"visibility": {
|
||||
"cliSummaryTable": true,
|
||||
"statusPage": true,
|
||||
"telemetry": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import sys
|
||||
|
||||
from create_database_utils import *
|
||||
from diagnostics_test_utils import *
|
||||
|
||||
os.environ['GITHUB_REPOSITORY'] = "a/b"
|
||||
run_codeql_database_create([], lang="go", source="work", db=None, runFunction=runUnsuccessfully)
|
||||
|
||||
check_diagnostics()
|
||||
@@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"./subpkg"
|
||||
)
|
||||
|
||||
func main() {
|
||||
subpkg.F()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package subpkg
|
||||
|
||||
import "fmt"
|
||||
|
||||
func F() {
|
||||
// It is required that there is an import in this package, which is import by another package using a local path
|
||||
fmt.Println("subpkg.F")
|
||||
}
|
||||
Reference in New Issue
Block a user