-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unlike `Report()` and `Suggest()`, new `Do()` method allows a more granular match action handling. Now it's possible to emit a conditional report/suggest message based on the matching context. The API is experimental and is likely to change.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dsl | ||
|
||
import ( | ||
"github.com/quasilyte/go-ruleguard/dsl/types" | ||
) | ||
|
||
type DoContext struct{} | ||
|
||
func (*DoContext) Var(varname string) *DoVar { return nil } | ||
|
||
func (*DoContext) SetReport(report string) {} | ||
|
||
func (*DoContext) SetSuggest(suggest string) {} | ||
|
||
type DoVar struct{} | ||
|
||
func (*DoVar) Text() string { return "" } | ||
|
||
func (*DoVar) Type() types.Type { return nil } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters