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 14, 2016
1 parent 3b73a58 commit 8c0748a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions bears/markdown/MarkdownBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
use_stdin=True,
output_format='corrected',
result_message='The text does not comply to the set style.')
@staticmethod
def generate_config(filename, file):
return filename


class MarkdownBear:
"""
Check and correct Markdown style violations automatically.
Expand Down Expand Up @@ -101,7 +106,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

0 comments on commit 8c0748a

Please sign in to comment.