From d2039c9f6b1b018e942d81042d743ab032d3d3aa Mon Sep 17 00:00:00 2001 From: Shubhendu Date: Wed, 30 Nov 2016 20:05:59 +0530 Subject: [PATCH] Incorporated review comments tendrl-bug-id: documentation/#64 Signed-off-by: Shubhendu --- .travis.yml | 3 +-- check_commit_message.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1575f8..acb978b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,13 @@ before_install: - "export TRAVIS_COMMIT_MSG=\\\"$(git log --format=%B --no-merges -n 1)\\" - "pip install requests" + - "yum install java" git: depth: 4 env: - URL=https://github.com/redpen-cc/redpen/releases/download/redpen-1.7.6 install: -- "pip install tox-travis" -- yum install java - wget $URL/redpen-1.7.6.tar.gz - tar xvf redpen-1.7.6.tar.gz - export PATH=$PATH:$PWD/redpen-distribution-1.7.6/bin diff --git a/check_commit_message.py b/check_commit_message.py index 57bb2ac..f4fbca3 100644 --- a/check_commit_message.py +++ b/check_commit_message.py @@ -7,7 +7,7 @@ commit_msg = str(os.environ['TRAVIS_COMMIT_MSG']) tendrl_bug_id = None tendrl_spec = None -github_base_url = "http://github.com/Tendrl" +github_base_url = "http://github.com" # Extract "tendrl-bug-id" and "tendrl-spec" name from the commit message @@ -29,8 +29,7 @@ "your commit msg") if tendrl_bug_id: - issue = "%s/%s/issues/%s" % (github_base_url, tendrl_bug_id.split( - "/")[0], tendrl_bug_id.split("/")[-1]) + issue = "%s/%s" % (github_base_url, tendrl_bug_id.replace("#", "/issues/")) if requests.get(issue).status_code != 200: raise Exception("Tendrl Bug specified in git commit msg not " "found!!\n"