mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #8495 from davidcian/circleci-diff-comment
Report style errors at the correct location.
This commit is contained in:
commit
ee3bb0475c
@ -44,6 +44,28 @@ function post_error_to_github
|
|||||||
--header 'content-type: application/json' \
|
--header 'content-type: application/json' \
|
||||||
-u stackenbotten:$GITHUB_ACCESS_TOKEN \
|
-u stackenbotten:$GITHUB_ACCESS_TOKEN \
|
||||||
--data "{\"body\": \"There was an error when running \`$CIRCLE_JOB\` for commit \`$CIRCLE_SHA1\`:\n\`\`\`\n$FORMATTED_ERROR_MSG\n\`\`\`\nPlease check that your changes are working as intended.\"}"
|
--data "{\"body\": \"There was an error when running \`$CIRCLE_JOB\` for commit \`$CIRCLE_SHA1\`:\n\`\`\`\n$FORMATTED_ERROR_MSG\n\`\`\`\nPlease check that your changes are working as intended.\"}"
|
||||||
|
|
||||||
|
post_review_comment_to_github
|
||||||
|
}
|
||||||
|
|
||||||
|
function post_review_comment_to_github
|
||||||
|
{
|
||||||
|
GITHUB_API_URL="https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER/comments"
|
||||||
|
|
||||||
|
sed -i 1d $ERROR_LOG
|
||||||
|
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
ERROR_PATH=$(echo $line | grep -oE ".*\.cpp")
|
||||||
|
ERROR_LINE=$(echo $line | grep -oE "[0-9]*")
|
||||||
|
|
||||||
|
curl --request POST \
|
||||||
|
--url $GITHUB_API_URL \
|
||||||
|
--header 'accept: application/vnd.github.v3+json, application/vnd.github.comfort-fade-preview+json' \
|
||||||
|
--header 'content-type: application/json' \
|
||||||
|
-u stackenbotten:$GITHUB_ACCESS_TOKEN \
|
||||||
|
--data "{\"commit_id\": \"$CIRCLE_SHA1\", \"path\": \"$ERROR_PATH\", \"line\": $ERROR_LINE, \"side\": \"LEFT\", \"body\": \"Coding style error\"}"
|
||||||
|
done < $ERROR_LOG
|
||||||
}
|
}
|
||||||
|
|
||||||
trap report_error_to_github EXIT
|
trap report_error_to_github EXIT
|
||||||
|
Loading…
Reference in New Issue
Block a user