Documentation
¶
Index ¶
- func AddTool(tool Tool)
- func GetToolDirectory() string
- func IsProject(root string) bool
- func SetupTools(ctx context.Context, currentVersion string) error
- type AdminTwigLinter
- type Check
- type Eslint
- type EslintOutput
- type FrontendTwigLinter
- func (s FrontendTwigLinter) Check(ctx context.Context, check *Check, config ToolConfig) error
- func (s FrontendTwigLinter) Fix(ctx context.Context, config ToolConfig) error
- func (a FrontendTwigLinter) Format(ctx context.Context, config ToolConfig, dryRun bool) error
- func (s FrontendTwigLinter) Name() string
- type PHPCSFixer
- type PhpStan
- type PhpStanOutput
- type Prettier
- type Rector
- type SWCLI
- type StyleLint
- type StylelintOutput
- type StylintError
- type Tool
- type ToolConfig
- type ToolList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetToolDirectory ¶
func GetToolDirectory() string
Types ¶
type AdminTwigLinter ¶
type AdminTwigLinter struct{}
func (AdminTwigLinter) Check ¶
func (a AdminTwigLinter) Check(ctx context.Context, check *Check, config ToolConfig) error
func (AdminTwigLinter) Fix ¶
func (a AdminTwigLinter) Fix(ctx context.Context, config ToolConfig) error
func (AdminTwigLinter) Format ¶
func (a AdminTwigLinter) Format(ctx context.Context, config ToolConfig, dryRun bool) error
func (AdminTwigLinter) Name ¶
func (a AdminTwigLinter) Name() string
type Check ¶
type Check struct {
Results []validation.CheckResult `json:"results"`
// contains filtered or unexported fields
}
func (*Check) AddResult ¶
func (c *Check) AddResult(result validation.CheckResult)
func (*Check) GetResults ¶
func (c *Check) GetResults() []validation.CheckResult
func (*Check) RemoveByIdentifier ¶
func (c *Check) RemoveByIdentifier(ignores []validation.ToolConfigIgnore) validation.Check
type EslintOutput ¶
type EslintOutput []struct {
FilePath string `json:"filePath"`
Messages []struct {
RuleID string `json:"ruleId"`
Severity int `json:"severity"`
Message string `json:"message"`
Line int `json:"line"`
Column int `json:"column"`
NodeType string `json:"nodeType"`
EndLine int `json:"endLine"`
EndColumn int `json:"endColumn"`
Fix struct {
Range []int `json:"range"`
Text string `json:"text"`
} `json:"fix,omitempty"`
MessageID string `json:"messageId,omitempty"`
} `json:"messages"`
SuppressedMessages []any `json:"suppressedMessages"`
ErrorCount int `json:"errorCount"`
FatalErrorCount int `json:"fatalErrorCount"`
WarningCount int `json:"warningCount"`
FixableErrorCount int `json:"fixableErrorCount"`
FixableWarningCount int `json:"fixableWarningCount"`
Source string `json:"source"`
UsedDeprecatedRules []any `json:"usedDeprecatedRules"`
}
type FrontendTwigLinter ¶ added in v0.0.3
type FrontendTwigLinter struct{}
func (FrontendTwigLinter) Check ¶ added in v0.0.3
func (s FrontendTwigLinter) Check(ctx context.Context, check *Check, config ToolConfig) error
func (FrontendTwigLinter) Fix ¶ added in v0.0.3
func (s FrontendTwigLinter) Fix(ctx context.Context, config ToolConfig) error
func (FrontendTwigLinter) Format ¶ added in v0.0.3
func (a FrontendTwigLinter) Format(ctx context.Context, config ToolConfig, dryRun bool) error
func (FrontendTwigLinter) Name ¶ added in v0.0.3
func (s FrontendTwigLinter) Name() string
type PHPCSFixer ¶
type PHPCSFixer struct{}
func (PHPCSFixer) Check ¶
func (p PHPCSFixer) Check(ctx context.Context, check *Check, config ToolConfig) error
func (PHPCSFixer) Fix ¶
func (p PHPCSFixer) Fix(ctx context.Context, config ToolConfig) error
func (PHPCSFixer) Format ¶
func (p PHPCSFixer) Format(ctx context.Context, config ToolConfig, dryRun bool) error
func (PHPCSFixer) Name ¶
func (p PHPCSFixer) Name() string
type PhpStanOutput ¶
type PhpStanOutput struct {
Totals struct {
Errors int `json:"errors"`
FileErrors int `json:"file_errors"`
} `json:"totals"`
Files map[string]struct {
Errors int `json:"errors"`
Messages []struct {
Message string `json:"message"`
Line int `json:"line"`
Ignorable bool `json:"ignorable"`
Identifier string `json:"identifier"`
} `json:"messages"`
} `json:"files"`
Errors []string `json:"errors"`
}
type StylelintOutput ¶
type StylelintOutput []struct {
Source string `json:"source"`
Deprecations []StylintError `json:"deprecations"`
InvalidOptionWarnings []any `json:"invalidOptionWarnings"`
ParseErrors []any `json:"parseErrors"`
Errored bool `json:"errored"`
Warnings []StylintError `json:"warnings"`
}
type StylintError ¶
type Tool ¶
type Tool interface {
Name() string
Check(ctx context.Context, check *Check, config ToolConfig) error
Fix(ctx context.Context, config ToolConfig) error
Format(ctx context.Context, config ToolConfig, dryRun bool) error
}
type ToolConfig ¶
type ToolConfig struct {
// Path to the tool directory
ToolDirectory string
InputWasDirectory bool
// The minimum version of HeyFrame that is supported
MinHeyFrameVersion string
// The maximum version of HeyFrame that is supported
MaxHeyFrameVersion string
// The version of HeyFrame that is checked against
CheckAgainst string
// The root directory of the extension/project
RootDir string
// Contains a list of directories that are considered as source code
SourceDirectories []string
// Contains a list of identifiers that are ignored
ValidationIgnores []validation.ToolConfigIgnore
// Contains a list of directories that are considered as admin code
AdminDirectories []string
// Contains a list of directories that are considered as frontend code
FrontendDirectories []string
Extension extension.Extension
}
func ConvertExtensionToToolConfig ¶
func ConvertExtensionToToolConfig(ext extension.Extension) (*ToolConfig, error)
func GetConfigFromProject ¶
func GetConfigFromProject(root string) (*ToolConfig, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.