-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It suggests better formatting in markdown files. Closes #1538
- Loading branch information
1 parent
1156567
commit 47b2e0d
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from coalib.bearlib.abstractions.Linter import linter | ||
from dependency_management.requirements.GoRequirement import GoRequirement | ||
|
||
|
||
@linter(executable='markdownfmt', | ||
output_format='corrected', | ||
result_message='Formatting can be improved.', | ||
use_stdin=True) | ||
class MarkdownfmtBear: | ||
""" | ||
Check and correct formatting of Markdown files using ``mardownfmt``. | ||
Basic checks like alignment, indendation are provided. | ||
Note that MarkdownfmtBear works only with pure Markdown files. | ||
""" | ||
LANGUAGES = {'Markdown'} | ||
REQUIREMENTS = {GoRequirement( | ||
package='github.com/shurcooL/markdownfmt')} | ||
AUTHORS = {'The coala developers'} | ||
AUTHORS_EMAILS = {'[email protected]'} | ||
LICENSE = 'AGPL-3.0' | ||
CAN_FIX = {'Formatting'} | ||
ASCIINEMA_URL = 'https://asciinema.org/a/396jhuyw1j0c1l2i9p09wlhye' | ||
SEE_MORE = 'https://github.com/shurcooL/markdownfmt' | ||
|
||
@staticmethod | ||
def create_arguments(filename, file, config_file): | ||
return list() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
|
||
from bears.markdown.MarkdownfmtBear import MarkdownfmtBear | ||
|
||
header_in_file1 = """ | ||
MarkdownBear | ||
===== | ||
""" | ||
|
||
header_out_file1 = """ | ||
MarkdownBear | ||
============ | ||
""" | ||
|
||
spacing_in_file2 = """ | ||
This is a test file. | ||
""" | ||
|
||
spacing_out_file2 = """ | ||
This is a test file. | ||
""" | ||
|
||
MarkdownfmtBear = verify_local_bear( | ||
MarkdownfmtBear, | ||
valid_files=(header_in_file1, spacing_in_file2,), | ||
invalid_files=(header_out_file1, spacing_out_file2,)) |