Esempio n. 1
0
    def test_find_files(self):
        sample_dir = self.get_sample_path()
        good = os.path.join(sample_dir, "good.md")
        sample1 = os.path.join(sample_dir, "sample1.md")
        sample2 = os.path.join(sample_dir, "sample2.md")
        files = MarkdownFileFinder.find_files(sample_dir)
        self.assertListEqual(files, [good, sample1, sample2])

        files = MarkdownFileFinder.find_files(sample_dir, filter="*.txt")
        txt1 = os.path.join(sample_dir, "ignored-sample1.txt")
        txt2 = os.path.join(sample_dir, "ignored-sample2.txt")
        self.assertListEqual(files, [txt1, txt2])
Esempio n. 2
0
def cli(list_files, config, ignore, path):
    """ Markdown lint tool, checks your markdown for styling issues """
    files = MarkdownFileFinder.find_files(path)
    if list_files:
        echo_files(files)

    lint_config = get_lint_config(config)
    lint_config.apply_on_csv_string(ignore, lint_config.disable_rule)

    linter = MarkdownLinter(lint_config)
    error_count = linter.lint_files(files)
    exit(error_count)
Esempio n. 3
0
def cli(list_files, config, ignore, path):
    """ Markdown lint tool, checks your markdown for styling issues """
    files = MarkdownFileFinder.find_files(path)
    if list_files:
        echo_files(files)

    lint_config = get_lint_config(config)
    lint_config.apply_on_csv_string(ignore, lint_config.disable_rule)

    linter = MarkdownLinter(lint_config)
    error_count = linter.lint_files(files)
    exit(error_count)