binana/go/app/cmd/lint/lint.go
superp00t 362bf7f31b
Some checks failed
Push / build (push) Has been cancelled
feat(bna): add 'as' subcommand to add symbols
2026-03-01 14:56:55 -05:00

45 lines
923 B
Go

package cmd
import (
"github.com/spf13/cobra"
"github.com/thunderbrewhq/binana/go/app"
"github.com/thunderbrewhq/binana/go/app/cmd/root"
"github.com/thunderbrewhq/binana/go/app/profile"
)
var lint_cmd = cobra.Command{
Use: "lint profile",
Short: "show warnings and coverage for a profile",
Run: lint_func,
}
func init() {
f := lint_cmd.Flags()
f.Bool("bounds", false, "check for bad function boundaries")
f.Bool("constructors", false, "check for outdated class constructor names")
root.RootCmd.AddCommand(&lint_cmd)
}
func lint_func(cmd *cobra.Command, args []string) {
if len(args) < 1 {
cmd.Help()
return
}
f := cmd.Flags()
var params profile.LintParams
params.Profile = args[0]
var err error
params.Constructors, err = f.GetBool("constructors")
if err != nil {
app.Fatal(err)
}
params.Bounds, err = f.GetBool("bounds")
if err != nil {
app.Fatal(err)
}
profile.Lint(&params)
}