Skip to content

Commit

Permalink
MarkdownBear: Verify the config_file
Browse files Browse the repository at this point in the history
If the config_file is provided, all other options are ignored.

Closes #925
  • Loading branch information
Nosferatul committed Nov 7, 2016
1 parent a5ce145 commit af26057
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bears/markdown/MarkdownBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def create_arguments(filename, file, config_file,
"ruleRepetition": markdown_horizontal_rule_repeat, # int
}

config_json = json.dumps(remark_configs)
# Remove { and } as remark adds them on its own
settings = config_json[1:-1]
return '--no-color', '--quiet', '--setting', settings
if config_file:
return '--no-color', '--quiet', '--setting', config_file
else:
config_json = json.dumps(remark_configs)
# Remove { and } as remark adds them on its own
settings = config_json[1:-1]
return '--no-color', '--quiet', '--setting', settings
7 changes: 7 additions & 0 deletions tests/markdown/MarkdownBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@
valid_files=(test_file1,),
invalid_files=(test_file2,),
settings={"markdown_list_increment": False})

if MarkdownBear.config_file:
MarkdownBearConfigsTest = verify_local_bear(
MarkdownBear,
valid_files=(test_file1,),
invalid_files=(test_file2,),
settings={"markdown_list_increment": False})

0 comments on commit af26057

Please sign in to comment.