Documentation
¶
Index ¶
- Variables
- func IsUnavailable(err error) bool
- func SetUnavailableReporter(reporter UnavailableReporter) func()
- type AnalyzeRequest
- type Diagnostic
- type FormatRequest
- type Runner
- func (r *Runner) Analyze(ctx context.Context, req AnalyzeRequest) ([]Diagnostic, error)
- func (r *Runner) Close(ctx context.Context) error
- func (r *Runner) Format(ctx context.Context, req FormatRequest) (string, error)
- func (r *Runner) FormatPowerShell(ctx context.Context, script string) (string, error)
- type Settings
- type SuggestedCorrection
- type UnavailableEvent
- type UnavailableReporter
Constants ¶
This section is empty.
Variables ¶
ErrUnavailable marks local PowerShell analyzer startup as unavailable.
Functions ¶
func IsUnavailable ¶
IsUnavailable reports whether err means the local PowerShell analyzer runtime is not available and callers should skip PowerShell analysis or formatting.
func SetUnavailableReporter ¶
func SetUnavailableReporter(reporter UnavailableReporter) func()
SetUnavailableReporter installs a process-local reporter for expected local PowerShell analyzer availability skips. The returned function restores the previous reporter.
Types ¶
type AnalyzeRequest ¶
type Diagnostic ¶
type Diagnostic struct {
RuleName string `json:"ruleName"`
Severity int `json:"severity"`
Line *int `json:"line"`
Column *int `json:"column"`
EndLine *int `json:"endLine"`
EndColumn *int `json:"endColumn"`
Message string `json:"message"`
ScriptPath string `json:"scriptPath"`
SuggestedCorrections []SuggestedCorrection `json:"suggestedCorrections,omitempty"`
}
type FormatRequest ¶
type FormatRequest struct {
ScriptDefinition string
}
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func SharedRunner ¶
func SharedRunner() *Runner
SharedRunner returns the process-wide runner for callers that should share one lazy PowerShell sidecar.
func (*Runner) Analyze ¶
func (r *Runner) Analyze(ctx context.Context, req AnalyzeRequest) ([]Diagnostic, error)
type SuggestedCorrection ¶
type UnavailableEvent ¶
type UnavailableEvent struct {
}
UnavailableEvent describes a skipped PowerShell analyzer operation.
type UnavailableReporter ¶
type UnavailableReporter func(UnavailableEvent)
UnavailableReporter receives non-diagnostic analyzer availability notices.
Click to show internal directories.
Click to hide internal directories.