You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the various WithX methods help set up a configuration for linting, the Lint method is currently where all the processing takes place (parsing, preparing the query, linting, preparing the result).
It would be great if the API offered a way to allow preparing for linting and linting in two separate steps, allowing the more flexible/performant use in some scenarios. Another benefit would be benchmarking, where it would be much easier to differentiate costs of linting if the cost of preparing to lint could be accounted for separately from the cost of linting (i.e. the Rego evaluation).
Obviously, we'll still want the current way to keep working. So I'd imagine the Lint() call would first check if there's a prepare state to start from, and if not, itself call Prepare() (or whatever we want to call it)
linter:=NewLinter().
WithInputPaths([]string{"../../bundle"}).
WithDisableAll(true).
WithEnabledRules("opa-fmt").
Prepare() // This would be newrep, err=linter.Lint(context.Background())
iferr!=nil {
panic(err)
}
The text was updated successfully, but these errors were encountered:
While the various
WithX
methods help set up a configuration for linting, theLint
method is currently where all the processing takes place (parsing, preparing the query, linting, preparing the result).It would be great if the API offered a way to allow preparing for linting and linting in two separate steps, allowing the more flexible/performant use in some scenarios. Another benefit would be benchmarking, where it would be much easier to differentiate costs of linting if the cost of preparing to lint could be accounted for separately from the cost of linting (i.e. the Rego evaluation).
Obviously, we'll still want the current way to keep working. So I'd imagine the
Lint()
call would first check if there's a prepare state to start from, and if not, itself callPrepare()
(or whatever we want to call it)The text was updated successfully, but these errors were encountered: