Skip to content

Commit

Permalink
feat: add --debug-graph option
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 17, 2018
1 parent d66ea22 commit a9332cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type runOptions struct {
ShowOrphans bool
EpicLabel string
Destination string
DebugGraph bool

Targets []string
//Preview bool
Expand All @@ -39,6 +40,7 @@ func (opts runOptions) String() string {
func runSetupFlags(flags *pflag.FlagSet, opts *runOptions) {
flags.BoolVarP(&opts.NoPull, "no-pull", "f", false, "do not pull new issues before runing")
flags.BoolVarP(&opts.ShowClosed, "show-closed", "", false, "show closed issues")
flags.BoolVarP(&opts.DebugGraph, "debug-graph", "", false, "debug graph")
flags.BoolVarP(&opts.ShowOrphans, "show-orphans", "", false, "show issues not linked to an epic")
flags.StringVarP(&opts.EpicLabel, "epic-label", "", "epic", "label used for epics (empty means issues with dependencies but without dependants)")
flags.StringVarP(&opts.Destination, "destination", "", "-", "destination ('-' for stdout)")
Expand Down
8 changes: 5 additions & 3 deletions graphviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
func graphviz(issues Issues, opts *runOptions) (string, error) {
var (
invisStyle = map[string]string{"style": "invis", "label": escape("")}
//invisStyle = map[string]string{}
weightMap = map[int]bool{}
weights = []int{}
weightMap = map[int]bool{}
weights = []int{}
)
if opts.DebugGraph {
invisStyle = map[string]string{}
}
for _, issue := range issues {
if issue.Hidden {
continue
Expand Down
2 changes: 1 addition & 1 deletion issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (issues Issues) prepare() error {
isDuplicateRegex, _ = regexp.Compile(`(?i)(duplicates|duplicate|dup of|dup|duplicate of) ([a-z0-9:/_.-]+#[0-9]+|[a-z0-9/_-]*#[0-9]+)`)
weightMultiplierRegex, _ = regexp.Compile(`(?i)(depviz.weight_multiplier[:= ]+)([0-9]+)`)
baseWeightRegex, _ = regexp.Compile(`(?i)(depviz.base_weight[:= ]+)([0-9]+)`)
hideFromRoadmapRegex, _ = regexp.Compile(`(?i)(depviz.hide_from_roadmap)`) // FIXME: use label
hideFromRoadmapRegex, _ = regexp.Compile(`(?i)(depviz.hide)`) // FIXME: use label
)

for _, issue := range issues {
Expand Down

0 comments on commit a9332cd

Please sign in to comment.