Skip to content

Commit

Permalink
change markdown code syntax by lang
Browse files Browse the repository at this point in the history
  • Loading branch information
takashi committed May 8, 2014
1 parent 59583a9 commit 5fde844
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions adapter_github.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (d *AdapterGithub) Update() error {
closedIssueTitles = append(closedIssueTitles, i.Title)
already++
} else {
frag := fmt.Sprintf("filename: %s\nline: %d\nlabel: %s\n\n```go\n%s\n```\n", i.FilePath, i.Line, i.Label, i.Fragment)
frag := fmt.Sprintf("filename: %s\nline: %d\nlabel: %s\n\n```%s\n%s\n```\n", i.FilePath, i.Line, i.Label, i.Lang, i.Fragment)
labels := []string{"erk", i.Label}
_, _, err := client.Issues.Create(repoInfo[0], repoInfo[1], &github.IssueRequest{Title: &i.Title, Body: &frag, Labels: labels})
if err != nil {
Expand All @@ -55,7 +55,7 @@ func (d *AdapterGithub) Update() error {
if roi != nil {
already++
} else {
frag := fmt.Sprintf("filename: %s\nline: %d\nlabel: %s\n\n```go\n%s\n```\n", i.FilePath, i.Line, i.Label, i.Fragment)
frag := fmt.Sprintf("filename: %s\nline: %d\nlabel: %s\n\n```%s\n%s\n```\n", i.FilePath, i.Line, i.Label, i.Lang, i.Fragment)
labels := []string{"erk", i.Label}
_, _, err := client.Issues.Create(repoInfo[0], repoInfo[1], &github.IssueRequest{Title: &i.Title, Body: &frag, Labels: labels})
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type Issue struct {
FilePath string
Fragment string
Label string
Lang string
Line int
Md5 string
}
Expand Down
3 changes: 2 additions & 1 deletion parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func ParseIssuesByLang(lang *language.Lang, path string, info os.FileInfo) error
Label: config.Label,
Line: line,
FilePath: path,
Fragment: frag}
Fragment: frag,
Lang: lang.Name}
IssueList = append(IssueList, issue)
}
line += 1
Expand Down

0 comments on commit 5fde844

Please sign in to comment.