Documentation
¶
Index ¶
- func GenerateNewPack(cli *codeql.CLI, opts GeneratePackOptions) error
- func GetPackName(packName string) string
- func GetPackScope(packName string) string
- func RunAnalyze(base, database, packRef string, format, output string, threads int) error
- type GeneratePackOptions
- type Pack
- func (p *Pack) CachePath() string
- func (p *Pack) CopyTo(destRoot string) (*Pack, error)
- func (p *Pack) CustomizationsPath() string
- func (p *Pack) DepsPath() string
- func (p *Pack) Dir() string
- func (p *Pack) IsCustomizable() bool
- func (p *Pack) IsTestPack() bool
- func (p *Pack) LockFilePath() string
- func (p *Pack) SaveConfig(updates map[string]interface{}) error
- type PackKind
- type QlpackConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateNewPack ¶ added in v0.0.3
func GenerateNewPack(cli *codeql.CLI, opts GeneratePackOptions) error
GenerateNewPack creates a new CodeQL query with scaffolding. It checks whether a pack with the same full name already exists via ListPacks unless args.Overwrite is true; in that case it returns an error.
func GetPackName ¶ added in v0.0.3
GetPackName returns the name part after the scope.
func GetPackScope ¶ added in v0.0.3
GetPackScope returns the scope part of the pack name (before "/").
Types ¶
type GeneratePackOptions ¶ added in v0.0.3
type GeneratePackOptions struct {
Base string
QueryName string
Lang string
Pack string
QueryKind string
CreateQueryPack bool
CreateTests bool
Overwrite bool
UseBundle bool
Library bool
}
GeneratePackOptions holds all arguments for the pack generate new-query command.
type Pack ¶
type Pack struct {
YmlPath string
Config QlpackConfig
Deps []*Pack
}
Pack is a resolved CodeQL pack.
func SelectPacks ¶ added in v0.1.0
SelectPacks resolves a list of pack names against allPacks. Names match by full name first, then by unique short name (segment after "/"). When names is empty, every pack is returned (filtered by skipTest). When skipTest is true, test packs are excluded from both the empty-filter result and from short/full name matching.
func (*Pack) CustomizationsPath ¶
CustomizationsPath returns the expected path for Customizations.qll.
func (*Pack) IsCustomizable ¶
IsCustomizable returns true if Customizations.qll already exists in the pack dir.
func (*Pack) IsTestPack ¶
IsTestPack returns true if the pack is a test pack, identified by either having an extractor field set or being located under a test/ directory.
func (*Pack) LockFilePath ¶
LockFilePath returns the path to codeql-pack.lock.yml.
func (*Pack) SaveConfig ¶
SaveConfig writes the in-memory qlpack.yml back to disk, preserving existing fields not tracked by QlpackConfig.
type QlpackConfig ¶
type QlpackConfig struct {
Name string `yaml:"name"`
Version string `yaml:"version"`
Library bool `yaml:"library"`
Dependencies map[string]string `yaml:"dependencies"`
Extractor string `yaml:"extractor"`
}
QlpackConfig holds the fields from qlpack.yml that qlt cares about.
func (*QlpackConfig) FullName ¶
func (c *QlpackConfig) FullName() string
func (*QlpackConfig) HasExtractor ¶
func (c *QlpackConfig) HasExtractor() bool
HasExtractor returns true if the pack has an extractor field set.
func (*QlpackConfig) ModuleName ¶
func (c *QlpackConfig) ModuleName() string
ModuleName converts "foo/cpp-customizations" → "foo.cpp_customizations" for use in QL import statements.
func (*QlpackConfig) PackName ¶
func (c *QlpackConfig) PackName() string
PackName returns the name part after the scope.
func (*QlpackConfig) Scope ¶
func (c *QlpackConfig) Scope() string
Scope returns the scope part of the pack name (before "/").