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 LatestBundleVersion() string
- func LatestCLIVersion() string
- type CLI
- func (c *CLI) Binary() string
- func (c *CLI) DatabaseAnalyze(opts DatabaseAnalyzeOptions) (*executil.Result, error)
- func (c *CLI) PackBundle(dir, output, commonCaches string) (*executil.Result, error)
- func (c *CLI) PackCreate(dir, output, commonCaches string) (*executil.Result, error)
- func (c *CLI) PackInstall(target, commonCaches string) (*executil.Result, error)
- func (c *CLI) PackLs(dir string) (*executil.Result, error)
- func (c *CLI) PackPublish(dir string) (*executil.Result, error)
- func (c *CLI) QueryCompile(threads int, files []string) (*executil.Result, error)
- func (c *CLI) ResolveLanguages() (*executil.Result, error)
- func (c *CLI) ResolveTests(dir string) (*executil.Result, error)
- func (c *CLI) Run(args ...string) (*executil.Result, error)
- func (c *CLI) TestRun(threads int, extraArgs, testFile string) (*executil.Result, error)
- type DatabaseAnalyzeOptions
Constants ¶
const ( FallbackCLIVersion = "2.25.1" FallbackBundleVersion = "codeql-bundle-v2.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 LatestBundleVersion ¶
func LatestBundleVersion() string
LatestBundleVersion returns the latest bundle tag (e.g. "codeql-bundle-v2.25.1"). Falls back to FallbackBundleVersion on any error.
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 executil.Runner and exposes one method per codeql subcommand that qlt invokes.
func (*CLI) DatabaseAnalyze ¶
func (c *CLI) DatabaseAnalyze(opts DatabaseAnalyzeOptions) (*executil.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 --output=<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>`. When commonCaches is "" the plain form is emitted; otherwise the cached form used by bundle assembly is emitted.
func (*CLI) PackPublish ¶
PackPublish runs `codeql pack publish <dir>`.
func (*CLI) QueryCompile ¶
QueryCompile runs `codeql query compile [--threads=N] -- <files>`.
func (*CLI) ResolveLanguages ¶
ResolveLanguages runs `codeql resolve languages --format=json`.
func (*CLI) ResolveTests ¶
ResolveTests runs `codeql resolve tests --strict-test-discovery --format json <dir>`.