From f14d5ffab6309377a0527ae4d16f91e43161bf5c Mon Sep 17 00:00:00 2001 From: Shresth Agrawal Date: Mon, 18 Mar 2019 17:41:45 +0100 Subject: [PATCH] Correct typos and Add exception of config file not found --- README.md | 2 +- release_bot/cli.py | 5 ++--- release_bot/init_repo.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1e803aa..92b1c87 100644 --- a/README.md +++ b/README.md @@ -169,7 +169,7 @@ Sample config named [release-conf-example.yaml](release-conf-example.yaml) can b ## GitChangeLog -For using the [gitchangelog](https://github.com/vaab/gitchangelog) you must add the line `gitchanelog = true` to the conf.yaml, and add the files `.gitchangelog.rc` and `markdown.tpl` in the root of your upstream project repository. Sample config files: [.gitchangelog.rc](/gitchangelog/.gitchangelog.rc) and [template.tpl](/gitchangelog/template.tpl). +For using the [gitchangelog](https://github.com/vaab/gitchangelog) you must add the line `gitchanelog: true` to the conf.yaml, and add the files `.gitchangelog.rc` and `markdown.tpl` in the root of your upstream project repository. Sample config files: [.gitchangelog.rc](/gitchangelog/.gitchangelog.rc) and [template.tpl](/gitchangelog/template.tpl). `.gitchangelog.rc` sample is heavily commented and should be enough to make modification but for specific details you can refer to the original [repository](https://github.com/vaab/gitchangelog). The default template `markdown.tpl` is configured to create Markdown divided into sections (New, Changes, Fix, Others) based on the commits. The data sent to the output engine [pystache](https://github.com/defunkt/pystache) by the gitchangelog is in the following [format](https://github.com/vaab/gitchangelog/edit/master/README.rst#L331-L356). You can use it to create a custom template, please refer [mustache](http://mustache.github.io/). diff --git a/release_bot/cli.py b/release_bot/cli.py index 91e0d8e..e18e32c 100644 --- a/release_bot/cli.py +++ b/release_bot/cli.py @@ -18,6 +18,7 @@ from pathlib import Path from release_bot.configuration import configuration +from release_bot.exceptions import ReleaseException class CLI: @@ -39,10 +40,8 @@ def run_bot(args): if args.configuration: args.configuration = Path(args.configuration).resolve() if not args.configuration.is_file(): - configuration.logger.error( + raise ReleaseException( f"Supplied configuration file is not found: {args.configuration}") - exit(1) - if args.debug: configuration.logger.setLevel(logging.DEBUG) for key, value in vars(args).items(): diff --git a/release_bot/init_repo.py b/release_bot/init_repo.py index e29a9b5..373abff 100644 --- a/release_bot/init_repo.py +++ b/release_bot/init_repo.py @@ -75,7 +75,7 @@ def create_conf(self): """ self.conf['repository_name'] = input('Please enter the repository name:') self.conf['repository_owner'] = input('Please enter the repository owner:') - print("""for details on how to get github token checkou + print("""for details on how to get github token checkout 'https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/'""") self.conf['github_token'] = input('Please enter your valid github token:') refresh_interval = input("""In how many seconds would you like the