Skip to content

Commit

Permalink
Merge branch 'feature/cli-comments-thumbs-up' into 'develop'
Browse files Browse the repository at this point in the history
Comment 👍 on success from Zally

See merge request pdds/zally!38
  • Loading branch information
Jay Anslow committed Feb 22, 2018
2 parents 53d2749 + 7074ac7 commit 78936f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
17 changes: 14 additions & 3 deletions cli/zally/cflzally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ echo "Linting $PATH..."
/usr/bin/zally lint --json $PATH > /tmp/zally.json
RESULT=$?

echo "Formatting markdown comment..."
if /usr/bin/jq --exit-status ".violations | length > 0" /tmp/zally.json; then

echo "Formatting markdown comment..."
/usr/bin/jq \
--raw-output \
"$JSONTOMARKDOWN" \
/tmp/zally.json > /tmp/zally.md
/bin/sed -e s/^/\ \ /g /tmp/zally.md

echo "Commenting on gitlab commit..."
echo "Commenting violations on gitlab commit..."
/usr/bin/curl \
--silent \
--request POST \
Expand All @@ -26,6 +25,18 @@ if /usr/bin/jq --exit-status ".violations | length > 0" /tmp/zally.json; then
--form "line=1" \
--form "line_type=new" \
${CI_PROJECT_URL}/../../api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_BUILD_REF}/comments

else
echo "Commenting success on gitlab commit..."
/usr/bin/curl \
--silent \
--request POST \
--header "PRIVATE-TOKEN: ${ZALLY_GITLAB_TOKEN}" \
--data "note=%F0%9F%91%8D" \
--data "path=$PATH" \
--data "line=1" \
--data "line_type=new" \
${CI_PROJECT_URL}/../../api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_BUILD_REF}/comments
fi

exit $RESULT
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class CoreFilingAPITest {
policy.withMoreIgnores(listOf(
"MatchingSummaryAndOperationIdNames",
"101", // UseOpenApiRule
"146", // LimitNumberOfResourcesRule
"150", // UseSpecificHttpStatusCodes
"151" // NotSpecifyStandardErrorCodesRule
)))
Expand Down

0 comments on commit 78936f2

Please sign in to comment.