mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
3d3b9d1217
* Add specdocs static code analyzer * docs pulling script * update content pulling script * add test * better parsing of incoming docs * update test * implements analyzer * separate tool * remove analyzer code * cleanup * deep source fixes * untrack raw specs files * add back phase0 defs * update spec texts * re-arrange code * updated spec list * cleanup * more comments and readme * add merkle proofs specs * add extra.md * mark wrong length issue * update readme * update readme * remove non-def snippets * update comment * check numrows * ignore last empty line Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
65 lines
1020 B
Go
65 lines
1020 B
Go
package main
|
|
|
|
import (
|
|
"embed"
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
)
|
|
|
|
var (
|
|
dirFlag = &cli.StringFlag{
|
|
Name: "dir",
|
|
Value: "",
|
|
Usage: "Target directory",
|
|
Required: true,
|
|
}
|
|
)
|
|
|
|
//go:embed data
|
|
var specFS embed.FS
|
|
|
|
var specDirs = map[string][]string{
|
|
"specs/phase0": {
|
|
"beacon-chain.md",
|
|
"fork-choice.md",
|
|
"validator.md",
|
|
"weak-subjectivity.md",
|
|
},
|
|
"ssz": {
|
|
"merkle-proofs.md",
|
|
},
|
|
}
|
|
|
|
func main() {
|
|
app := &cli.App{
|
|
Name: "Specs checker utility",
|
|
Description: "Checks that specs pseudo code used in comments is up to date",
|
|
Usage: "helps keeping specs pseudo code up to date!",
|
|
Commands: []*cli.Command{
|
|
{
|
|
Name: "check",
|
|
Usage: "Checks that all doc strings",
|
|
Flags: []cli.Flag{
|
|
dirFlag,
|
|
},
|
|
Action: check,
|
|
},
|
|
{
|
|
Name: "download",
|
|
Usage: "Downloads the latest specs docs",
|
|
Action: download,
|
|
Flags: []cli.Flag{
|
|
dirFlag,
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
err := app.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|