Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating spec #4

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions check/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,25 @@
// No IDs can overlap with Rule IDs in Rules.
Categories []*CategorySpec

// TODO: given how common this could be, should ANY plugin implementing the pluginrpc
// be able to, optionally, define the License and Doc?
//
// https://buf.build/pluginrpc/pluginrpc/docs/main:pluginrpc.v1#pluginrpc.v1.Spec
License *LicenseSpec
Doc string

// Before is a function that will be executed before any RuleHandlers are
// invoked that returns a new Context and Request. This new Context and
// Request will be passed to the RuleHandlers. This allows for any
// pre-processing that needs to occur.
Before func(ctx context.Context, request Request) (context.Context, Request, error)
}

type LicenseSpec struct {
SPDXLicense spdx.License

Check failure on line 59 in check/spec.go

View workflow job for this annotation

GitHub Actions / ci (1.22.x)

undefined: spdx

Check failure on line 59 in check/spec.go

View workflow job for this annotation

GitHub Actions / ci (1.23.x)

undefined: spdx

Check failure on line 59 in check/spec.go

View workflow job for this annotation

GitHub Actions / ci (1.23.x)

undefined: spdx
Text string
}

// ValidateSpec validates all values on a Spec.
//
// This is exposed publicly so it can be run as part of plugin tests. This will verify
Expand Down
Loading