forked from RasaHQ/rasa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simpler list view * lint * readding graph viz with -g/--graph Co-authored-by: Leonid Shamis <[email protected]> Co-authored-by: Casey Lee <[email protected]>
- Loading branch information
1 parent
014d71a
commit 644bc2b
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ on: | |
|
||
jobs: | ||
stale: | ||
name: Stale | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"strconv" | ||
|
||
"github.com/nektos/act/pkg/model" | ||
) | ||
|
||
func printList(plan *model.Plan) error { | ||
type lineInfoDef struct { | ||
id string | ||
stage string | ||
name string | ||
} | ||
lineInfos := []lineInfoDef{} | ||
|
||
header := lineInfoDef{ | ||
id: "ID", | ||
stage: "Stage", | ||
name: "Name", | ||
} | ||
|
||
idMaxWidth := len(header.id) | ||
stageMaxWidth := len(header.stage) | ||
nameMaxWidth := len(header.name) | ||
|
||
for i, stage := range plan.Stages { | ||
for _, r := range stage.Runs { | ||
line := lineInfoDef{ | ||
id: r.JobID, | ||
stage: strconv.Itoa(i), | ||
name: r.String(), | ||
} | ||
lineInfos = append(lineInfos, line) | ||
if idMaxWidth < len(line.id) { | ||
idMaxWidth = len(line.id) | ||
} | ||
if stageMaxWidth < len(line.stage) { | ||
stageMaxWidth = len(line.stage) | ||
} | ||
if nameMaxWidth < len(line.name) { | ||
nameMaxWidth = len(line.name) | ||
} | ||
} | ||
} | ||
|
||
idMaxWidth += 2 | ||
stageMaxWidth += 2 | ||
nameMaxWidth += 2 | ||
|
||
fmt.Printf("%*s%*s%*s\n", -idMaxWidth, header.id, -stageMaxWidth, header.stage, -nameMaxWidth, header.name) | ||
for _, line := range lineInfos { | ||
fmt.Printf("%*s%*s%*s\n", -idMaxWidth, line.id, -stageMaxWidth, line.stage, -nameMaxWidth, line.name) | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters