Skip to content

Commit

Permalink
refactor(pkg/validate): deprecate old validation mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido committed Mar 23, 2023
1 parent 12cada0 commit b27cbfc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 46 deletions.
6 changes: 3 additions & 3 deletions pkg/cmd/flags/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ type Registry struct {
}

type Pull struct {
ID int `name:"github pull request ID" flag:"gh-pull-id" desc:"set the GitHub pull request ID" validate:"required_if=Reporter github-pr-review" flagset:"Reporting" json:"gh-pull-id"`
ID int `name:"github pull request ID" flag:"gh-pull-id" desc:"set the GitHub pull request ID" flagset:"Reporting" json:"gh-pull-id"`
}

type GitHub struct {
Owner string `name:"github owner" flag:"gh-owner" desc:"set the GitHub owner name (org|user)" validate:"required_if=Reporter github-pr-review" flagset:"Reporting" json:"gh-owner"`
Repo string `name:"github repository" flag:"gh-repo" desc:"set the GitHub repository name" validate:"required_if=Reporter github-pr-review" flagset:"Reporting" json:"gh-repo"`
Owner string `name:"github owner" flag:"gh-owner" desc:"set the GitHub owner name (org|user)" flagset:"Reporting" json:"gh-owner"`
Repo string `name:"github repository" flag:"gh-repo" desc:"set the GitHub repository name" flagset:"Reporting" json:"gh-repo"`
Pull
}

Expand Down
40 changes: 0 additions & 40 deletions pkg/validate/reporter.go

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ func init() {
if err := Singleton.RegisterValidation("version_constraint", isVersionConstraint); err != nil {
panic(err)
}
if err := Singleton.RegisterValidation("reporter", isReporterAvailable); err != nil {
panic(err)
}

Singleton.RegisterAlias("shasum", "len=40")
Singleton.RegisterAlias("mandatory", "required")
Expand Down

0 comments on commit b27cbfc

Please sign in to comment.