Skip to content

Commit

Permalink
Azure Devops: Improve comment formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdafydd committed Nov 27, 2019
1 parent 5c40266 commit c017e73
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 5,852 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ require (
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.20.2
gopkg.in/russross/blackfriday.v2 v2.0.0
gopkg.in/yaml.v2 v2.2.2
gotest.tools v2.2.0+incompatible // indirect
)
8 changes: 1 addition & 7 deletions server/events/vcs/azuredevops_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/pkg/errors"
"github.com/runatlantis/atlantis/server/events/models"
"github.com/runatlantis/atlantis/server/events/vcs/common"
"gopkg.in/russross/blackfriday.v2"
)

// AzureDevopsClient represents an Azure DevOps VCS client
Expand Down Expand Up @@ -84,9 +83,6 @@ func (g *AzureDevopsClient) GetModifiedFiles(repo models.Repo, pull models.PullR
//
// If comment length is greater than the max comment length we split into
// multiple comments.
// Azure DevOps doesn't support markdown in Work Item comments, but it will
// convert text to HTML. We use the blackfriday library to convert Atlantis
// comment markdown before submission.
func (g *AzureDevopsClient) CreateComment(repo models.Repo, pullNum int, comment string) error {
sepEnd := "\n```\n</details>" +
"\n<br>\n\n**Warning**: Output length greater than max comment size. Continued in next comment."
Expand All @@ -102,14 +98,12 @@ func (g *AzureDevopsClient) CreateComment(repo models.Repo, pullNum int, comment
owner, project, repoName := SplitAzureDevopsRepoFullName(repo.FullName)

for _, c := range comments {
input := blackfriday.Run([]byte(c))
s := string(input)
commentType := "text"
parentCommentID := 0

prComment := azuredevops.Comment{
CommentType: &commentType,
Content: &s,
Content: &c,
ParentCommentID: &parentCommentID,
}
prComments := []*azuredevops.Comment{&prComment}
Expand Down
8 changes: 0 additions & 8 deletions vendor/gopkg.in/russross/blackfriday.v2/.gitignore

This file was deleted.

18 changes: 0 additions & 18 deletions vendor/gopkg.in/russross/blackfriday.v2/.travis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions vendor/gopkg.in/russross/blackfriday.v2/LICENSE.txt

This file was deleted.

283 changes: 0 additions & 283 deletions vendor/gopkg.in/russross/blackfriday.v2/README.md

This file was deleted.

Loading

0 comments on commit c017e73

Please sign in to comment.