Skip to content

Commit 0c4b0c0

Browse files
Bramdemerphq
authored andcommitted
Tidy output of perlbug for pasting on GitHub
Clean up the report created by `perlbug` so that it looks better when pasted in a GitHub issue: - Put the 'perl configuration' in a code-block - Hide some sentences - Clean up 'Flags' section (it was shown as a very big header and taking up quite a lot of space) - Add `**Description**`, `**Steps to Reproduce**` and `**Expected behaviour**` in the body of the report (similar to the GitHub issue template) - If this is a report about a core module then also put the name of the Module at the top (it's still included in 'Flags' as well) - ... (There are two newlines added before 'Flags', this is to deal with someone using `perlbug -b foo`, without the newlines GitHub would make turn the 'foo' into a title)
1 parent b5b600e commit 0c4b0c0

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

utils/perlbug.PL

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ BEGIN {
8686
$::HaveWrap = ($@ eq "");
8787
};
8888
89-
our $VERSION = "1.42";
89+
our $VERSION = "1.43";
9090
9191
#TODO:
9292
# make sure failure (transmission-wise) of Mail::Send is accounted for.
@@ -620,6 +620,10 @@ generated with the help of perlbug $VERSION running under perl $perl_version.
620620
621621
EOF
622622
623+
if ($report_about_module) {
624+
print REP "Module: $report_about_module\n\n";
625+
}
626+
623627
if ($body) {
624628
print REP $body;
625629
} elsif ($usefile) {
@@ -646,12 +650,25 @@ EOF
646650
print REP <<'EOF';
647651
648652
-----------------------------------------------------------------
649-
[Please describe your issue here]
653+
<!--[Please describe your issue here]-->
650654
655+
**Description**
656+
<!-- A clear and concise description of what the bug is. -->
651657
652658
653-
[Please do not change anything below this line]
654-
-----------------------------------------------------------------
659+
660+
**Steps to Reproduce**
661+
<!-- A one-liner or script to reproduce the issue. -->
662+
663+
664+
665+
**Expected behavior**
666+
<!-- A clear and concise description of what you expected to happen. -->
667+
668+
669+
670+
<!--[Please do not change anything below this line]-->
671+
<!------------------------------------------------------------------- -->
655672
EOF
656673
}
657674
}
@@ -671,26 +688,30 @@ sub Dump {
671688
$severity ||= 'low';
672689
673690
print OUT <<EFF;
691+
692+
674693
---
675-
Flags:
676-
category=$category
677-
severity=$severity
694+
**Flags**
695+
- category=$category
696+
- severity=$severity
678697
EFF
679698
680699
if ($has_patch) {
681700
print OUT <<EFF;
682-
Type=Patch
683-
PatchStatus=HasPatch
701+
- Type=Patch
702+
- PatchStatus=HasPatch
684703
EFF
685704
}
686705
687706
if ($report_about_module ) {
688707
print OUT <<EFF;
689-
module=$report_about_module
708+
- module=$report_about_module
690709
EFF
691710
}
692711
print OUT <<EFF;
693712
---
713+
**Perl configuration**
714+
```
694715
EFF
695716
print OUT "This perlbug was built using Perl $config_tag1\n",
696717
"It is being executed now by Perl $config_tag2.\n\n"
@@ -745,6 +766,7 @@ EOF
745766
print OUT "$_='$value'\n";
746767
}
747768
}
769+
print OUT "```\n";
748770
} # sub Dump
749771
750772
sub Edit {

0 commit comments

Comments
 (0)