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 e033ec4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions bears/markdown/MarkdownBear.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import json

from coalib.bearlib.abstractions.Linter import linter
from coalib.bearlib.abstractions.Linter import linter, _create_linter.LinterBase
from coalib.bears.requirements.NpmRequirement import NpmRequirement


@linter(executable='remark',
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 e033ec4

Please sign in to comment.