Documentation
¶
Index ¶
- func GenerateNewQuery(cli *codeql.CLI, args GenerateArgs) error
- type GenerateArgs
- 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 GenerateNewQuery ¶ added in v0.0.2
func GenerateNewQuery(cli *codeql.CLI, args GenerateArgs) error
GenerateNewQuery 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.
Types ¶
type GenerateArgs ¶ added in v0.0.2
type GenerateArgs struct {
Base string
QueryName string
Lang string
Pack string
Scope string
QueryKind string
CreateQueryPack bool
CreateTests bool
Overwrite bool
UseBundle bool
}
GenerateArgs 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 (*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 "/").