-
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
012b7d1
commit cb8b35f
Showing
3 changed files
with
37 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,29 @@ | ||
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: | ||
""" | ||
Suggests better formatting in Markdown files. Basic checks | ||
like alignment, indendation are provided. | ||
For more information visit | ||
<https://github.com/shurcooL/markdownfmt> | ||
Note that MarkdownfmtBear works 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' | ||
|
||
@staticmethod | ||
def create_arguments(filename, file, config_file): | ||
return() |
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,7 @@ | ||
from bears.markdown.MarkdownfmtBear import MarkdownfmtBear | ||
from coalib.testing.LocalBearTestHelper import verify_local_bear | ||
|
||
MarkdownfmtBear = verify_local_bear( | ||
MarkdownfmtBear, | ||
('package main\n\nfunc main() {\n\treturn 1\n}',), | ||
('package main\nfunc main() {\n\treturn 1\n}',)) |