Skip to content

Commit b68db8d

Browse files
authored
Merge pull request #1504 from urfave/generate-in-ci
Ensure "generate" step runs in CI prior to diff check
2 parents 3c5c3a4 + 507530d commit b68db8d

File tree

3 files changed

+70
-16
lines changed

3 files changed

+70
-16
lines changed

.github/workflows/cli.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
GFLAGS: -tags urfave_cli_no_docs
4141
- run: make check-binary-size
4242
- run: make yamlfmt
43+
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
44+
run: make generate
4345
- run: make diffcheck
4446
- if: matrix.go == '1.19.x' && matrix.os == 'ubuntu-latest'
4547
run: make v2diff

godoc-current.txt

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ type BoolFlag struct {
458458
EnvVars []string
459459

460460
Count *int
461+
462+
Action func(*Context, bool) error
461463
}
462464
BoolFlag is a flag with type bool
463465

@@ -565,7 +567,6 @@ type Command struct {
565567
// cli.go uses text/template to render templates. You can
566568
// render custom help text by setting this variable.
567569
CustomHelpTemplate string
568-
569570
// Has unexported fields.
570571
}
571572
Command is a subcommand for a cli.App.
@@ -584,13 +585,6 @@ func (c *Command) Run(ctx *Context) (err error)
584585
Run invokes the command given the context, parses ctx.Args() to generate
585586
command-specific flags
586587

587-
func (c *Command) VisibleCategories() []CommandCategory
588-
VisibleCategories returns a slice of categories and commands that are
589-
Hidden=false
590-
591-
func (c *Command) VisibleCommands() []*Command
592-
VisibleCommands returns a slice of the Commands with Hidden=false
593-
594588
func (c *Command) VisibleFlagCategories() []VisibleFlagCategory
595589
VisibleFlagCategories returns a slice containing all the visible flag
596590
categories with the flags they contain
@@ -776,6 +770,8 @@ type DurationFlag struct {
776770

777771
Aliases []string
778772
EnvVars []string
773+
774+
Action func(*Context, time.Duration) error
779775
}
780776
DurationFlag is a flag with type time.Duration
781777

@@ -952,6 +948,8 @@ type Float64Flag struct {
952948

953949
Aliases []string
954950
EnvVars []string
951+
952+
Action func(*Context, float64) error
955953
}
956954
Float64Flag is a flag with type float64
957955

@@ -1038,6 +1036,8 @@ type Float64SliceFlag struct {
10381036

10391037
Aliases []string
10401038
EnvVars []string
1039+
1040+
Action func(*Context, []float64) error
10411041
}
10421042
Float64SliceFlag is a flag with type *Float64Slice
10431043

@@ -1115,6 +1115,8 @@ type GenericFlag struct {
11151115
EnvVars []string
11161116

11171117
TakesFile bool
1118+
1119+
Action func(*Context, interface{}) error
11181120
}
11191121
GenericFlag is a flag with type Generic
11201122

@@ -1181,6 +1183,8 @@ type Int64Flag struct {
11811183
EnvVars []string
11821184

11831185
Base int
1186+
1187+
Action func(*Context, int64) error
11841188
}
11851189
Int64Flag is a flag with type int64
11861190

@@ -1267,6 +1271,8 @@ type Int64SliceFlag struct {
12671271

12681272
Aliases []string
12691273
EnvVars []string
1274+
1275+
Action func(*Context, []int64) error
12701276
}
12711277
Int64SliceFlag is a flag with type *Int64Slice
12721278

@@ -1338,6 +1344,8 @@ type IntFlag struct {
13381344
EnvVars []string
13391345

13401346
Base int
1347+
1348+
Action func(*Context, int) error
13411349
}
13421350
IntFlag is a flag with type int
13431351

@@ -1428,6 +1436,8 @@ type IntSliceFlag struct {
14281436

14291437
Aliases []string
14301438
EnvVars []string
1439+
1440+
Action func(*Context, []int) error
14311441
}
14321442
IntSliceFlag is a flag with type *IntSlice
14331443

@@ -1533,6 +1543,8 @@ type PathFlag struct {
15331543
EnvVars []string
15341544

15351545
TakesFile bool
1546+
1547+
Action func(*Context, Path) error
15361548
}
15371549
PathFlag is a flag with type Path
15381550

@@ -1673,6 +1685,8 @@ type StringFlag struct {
16731685
EnvVars []string
16741686

16751687
TakesFile bool
1688+
1689+
Action func(*Context, string) error
16761690
}
16771691
StringFlag is a flag with type string
16781692

@@ -1761,6 +1775,8 @@ type StringSliceFlag struct {
17611775
EnvVars []string
17621776

17631777
TakesFile bool
1778+
1779+
Action func(*Context, []string) error
17641780
}
17651781
StringSliceFlag is a flag with type *StringSlice
17661782

@@ -1867,6 +1883,8 @@ type TimestampFlag struct {
18671883
Layout string
18681884

18691885
Timezone *time.Location
1886+
1887+
Action func(*Context, *time.Time) error
18701888
}
18711889
TimestampFlag is a flag with type *Timestamp
18721890

@@ -1932,6 +1950,8 @@ type Uint64Flag struct {
19321950
EnvVars []string
19331951

19341952
Base int
1953+
1954+
Action func(*Context, uint64) error
19351955
}
19361956
Uint64Flag is a flag with type uint64
19371957

@@ -2018,6 +2038,8 @@ type Uint64SliceFlag struct {
20182038

20192039
Aliases []string
20202040
EnvVars []string
2041+
2042+
Action func(*Context, []uint64) error
20212043
}
20222044
Uint64SliceFlag is a flag with type *Uint64Slice
20232045

@@ -2080,6 +2102,8 @@ type UintFlag struct {
20802102
EnvVars []string
20812103

20822104
Base int
2105+
2106+
Action func(*Context, uint) error
20832107
}
20842108
UintFlag is a flag with type uint
20852109

@@ -2170,6 +2194,8 @@ type UintSliceFlag struct {
21702194

21712195
Aliases []string
21722196
EnvVars []string
2197+
2198+
Action func(*Context, []uint) error
21732199
}
21742200
UintSliceFlag is a flag with type *UintSlice
21752201

testdata/godoc-v2.x.txt

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ type BoolFlag struct {
458458
EnvVars []string
459459

460460
Count *int
461+
462+
Action func(*Context, bool) error
461463
}
462464
BoolFlag is a flag with type bool
463465

@@ -565,7 +567,6 @@ type Command struct {
565567
// cli.go uses text/template to render templates. You can
566568
// render custom help text by setting this variable.
567569
CustomHelpTemplate string
568-
569570
// Has unexported fields.
570571
}
571572
Command is a subcommand for a cli.App.
@@ -584,13 +585,6 @@ func (c *Command) Run(ctx *Context) (err error)
584585
Run invokes the command given the context, parses ctx.Args() to generate
585586
command-specific flags
586587

587-
func (c *Command) VisibleCategories() []CommandCategory
588-
VisibleCategories returns a slice of categories and commands that are
589-
Hidden=false
590-
591-
func (c *Command) VisibleCommands() []*Command
592-
VisibleCommands returns a slice of the Commands with Hidden=false
593-
594588
func (c *Command) VisibleFlagCategories() []VisibleFlagCategory
595589
VisibleFlagCategories returns a slice containing all the visible flag
596590
categories with the flags they contain
@@ -776,6 +770,8 @@ type DurationFlag struct {
776770

777771
Aliases []string
778772
EnvVars []string
773+
774+
Action func(*Context, time.Duration) error
779775
}
780776
DurationFlag is a flag with type time.Duration
781777

@@ -952,6 +948,8 @@ type Float64Flag struct {
952948

953949
Aliases []string
954950
EnvVars []string
951+
952+
Action func(*Context, float64) error
955953
}
956954
Float64Flag is a flag with type float64
957955

@@ -1038,6 +1036,8 @@ type Float64SliceFlag struct {
10381036

10391037
Aliases []string
10401038
EnvVars []string
1039+
1040+
Action func(*Context, []float64) error
10411041
}
10421042
Float64SliceFlag is a flag with type *Float64Slice
10431043

@@ -1115,6 +1115,8 @@ type GenericFlag struct {
11151115
EnvVars []string
11161116

11171117
TakesFile bool
1118+
1119+
Action func(*Context, interface{}) error
11181120
}
11191121
GenericFlag is a flag with type Generic
11201122

@@ -1181,6 +1183,8 @@ type Int64Flag struct {
11811183
EnvVars []string
11821184

11831185
Base int
1186+
1187+
Action func(*Context, int64) error
11841188
}
11851189
Int64Flag is a flag with type int64
11861190

@@ -1267,6 +1271,8 @@ type Int64SliceFlag struct {
12671271

12681272
Aliases []string
12691273
EnvVars []string
1274+
1275+
Action func(*Context, []int64) error
12701276
}
12711277
Int64SliceFlag is a flag with type *Int64Slice
12721278

@@ -1338,6 +1344,8 @@ type IntFlag struct {
13381344
EnvVars []string
13391345

13401346
Base int
1347+
1348+
Action func(*Context, int) error
13411349
}
13421350
IntFlag is a flag with type int
13431351

@@ -1428,6 +1436,8 @@ type IntSliceFlag struct {
14281436

14291437
Aliases []string
14301438
EnvVars []string
1439+
1440+
Action func(*Context, []int) error
14311441
}
14321442
IntSliceFlag is a flag with type *IntSlice
14331443

@@ -1533,6 +1543,8 @@ type PathFlag struct {
15331543
EnvVars []string
15341544

15351545
TakesFile bool
1546+
1547+
Action func(*Context, Path) error
15361548
}
15371549
PathFlag is a flag with type Path
15381550

@@ -1673,6 +1685,8 @@ type StringFlag struct {
16731685
EnvVars []string
16741686

16751687
TakesFile bool
1688+
1689+
Action func(*Context, string) error
16761690
}
16771691
StringFlag is a flag with type string
16781692

@@ -1761,6 +1775,8 @@ type StringSliceFlag struct {
17611775
EnvVars []string
17621776

17631777
TakesFile bool
1778+
1779+
Action func(*Context, []string) error
17641780
}
17651781
StringSliceFlag is a flag with type *StringSlice
17661782

@@ -1867,6 +1883,8 @@ type TimestampFlag struct {
18671883
Layout string
18681884

18691885
Timezone *time.Location
1886+
1887+
Action func(*Context, *time.Time) error
18701888
}
18711889
TimestampFlag is a flag with type *Timestamp
18721890

@@ -1932,6 +1950,8 @@ type Uint64Flag struct {
19321950
EnvVars []string
19331951

19341952
Base int
1953+
1954+
Action func(*Context, uint64) error
19351955
}
19361956
Uint64Flag is a flag with type uint64
19371957

@@ -2018,6 +2038,8 @@ type Uint64SliceFlag struct {
20182038

20192039
Aliases []string
20202040
EnvVars []string
2041+
2042+
Action func(*Context, []uint64) error
20212043
}
20222044
Uint64SliceFlag is a flag with type *Uint64Slice
20232045

@@ -2080,6 +2102,8 @@ type UintFlag struct {
20802102
EnvVars []string
20812103

20822104
Base int
2105+
2106+
Action func(*Context, uint) error
20832107
}
20842108
UintFlag is a flag with type uint
20852109

@@ -2170,6 +2194,8 @@ type UintSliceFlag struct {
21702194

21712195
Aliases []string
21722196
EnvVars []string
2197+
2198+
Action func(*Context, []uint) error
21732199
}
21742200
UintSliceFlag is a flag with type *UintSlice
21752201

0 commit comments

Comments
 (0)