Documentation
¶
Overview ¶
Resolves the latest CodeQL release versions from GitHub's redirect headers, avoiding the rate-limited JSON API.
Index ¶
- Constants
- func Download(version, platform string) (p string, err error)
- func Install(base, platform string) error
- func LatestCLIVersion() string
- type CLI
- func (c *CLI) Binary() string
- func (c *CLI) DatabaseAnalyze(opts DatabaseAnalyzeOptions) (*Result, error)
- func (c *CLI) PackBundle(dir, output, commonCaches string) (*Result, error)
- func (c *CLI) PackCreate(dir, output, commonCaches string) (*Result, error)
- func (c *CLI) PackInstall(target, commonCaches string) (*Result, error)
- func (c *CLI) PackLs(dir string) (*Result, error)
- func (c *CLI) PackPublish(dir string) (*Result, error)
- func (c *CLI) PackResolveDependencies(dir string) (*Result, error)
- func (c *CLI) QueryCompile(threads int, files ...string) (*Result, error)
- func (c *CLI) ResolveLanguages() (*Result, error)
- func (c *CLI) ResolvePacks() (*Result, error)
- func (c *CLI) ResolveTests(dir string) (*Result, error)
- func (c *CLI) Run(args ...string) (*Result, error)
- func (c *CLI) TestRun(threads int, extraArgs, testFile string) (*Result, error)
- type DatabaseAnalyzeOptions
- type Result
- type RunError
- type Runner
Constants ¶
const (
FallbackCLIVersion = "2.25.1"
)
Variables ¶
This section is empty.
Functions ¶
func Install ¶
Install downloads and installs the CodeQL CLI or bundle based on config. When EnableCustomCodeQLBundles is true in config, the bundle is installed; otherwise the standalone CLI is used. version overrides the config value for CLI installs.
func LatestCLIVersion ¶
func LatestCLIVersion() string
LatestCLIVersion returns the latest CodeQL CLI version string (e.g. "2.25.1"). Falls back to FallbackCLIVersion on any error.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI is a typed wrapper around the codeql binary. It owns an Runner and exposes one method per codeql subcommand that qlt invokes.
func (*CLI) DatabaseAnalyze ¶
func (c *CLI) DatabaseAnalyze(opts DatabaseAnalyzeOptions) (*Result, error)
DatabaseAnalyze runs `codeql database analyze --format=... --output=... --threads=N --rerun [--additional-packs=...] <db> <query>`.
func (*CLI) PackBundle ¶
PackBundle runs `codeql pack bundle --format=json --pack-path=<output> [--common-caches=<caches>] <dir>`.
func (*CLI) PackCreate ¶
PackCreate runs `codeql pack create --format=json --output=<output> [--common-caches=<caches>] <dir>`.
func (*CLI) PackInstall ¶
PackInstall runs `codeql pack install --format=json [--common-caches=<caches>] <target>`.
func (*CLI) PackPublish ¶
PackPublish runs `codeql pack publish <dir>`.
func (*CLI) PackResolveDependencies ¶ added in v0.0.2
PackResolveDependencies runs `codeql pack resolve-dependencies --format=json <dir>`.
func (*CLI) QueryCompile ¶
QueryCompile runs `codeql query compile [--threads=N] -- <files>`.
func (*CLI) ResolveLanguages ¶
ResolveLanguages runs `codeql resolve languages --format=json`.
func (*CLI) ResolvePacks ¶ added in v0.0.2
ResolvePacks runs `codeql resolve packs --format=json`.
func (*CLI) ResolveTests ¶
ResolveTests runs `codeql resolve tests --strict-test-discovery --format json <dir>`.
type DatabaseAnalyzeOptions ¶
type DatabaseAnalyzeOptions struct {
Database string
QueryFile string
Format string
Output string
Threads int
AdditionalPacks string
}
DatabaseAnalyzeOptions collects the flags used by RunQuery.
type Result ¶ added in v0.1.0
Result contains captured command output.
func (*Result) StderrString ¶ added in v0.1.0
func (*Result) StdoutString ¶ added in v0.1.0
type RunError ¶ added in v0.1.0
RunError includes command details and captured stderr for failed runs.