Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit prepares the package for an initial release on PyPI: - Updates pyproject.toml file for release - Adds tests - Adds Python 3.6 and PyPy3.6 support - Adds Tox for local testing - Adds Travis CI - Adds EditorConfig - Improves README - Adds LICENSE file
- Loading branch information
1 parent
db882f1
commit 4d91634
Showing
11 changed files
with
238 additions
and
147 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{py,md,toml}] | ||
indent_style = space | ||
indent_size = 4 |
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,15 @@ | ||
dist: xenial # required for Python >= 3.7 | ||
language: python | ||
cache: pip | ||
matrix: | ||
include: | ||
- name: "3.6" | ||
python: 3.6 | ||
- name: "3.7" | ||
python: 3.7 | ||
before_install: | ||
- pip install poetry | ||
install: | ||
- poetry install -v | ||
script: | ||
- pytest |
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,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 John Franey | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
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 |
---|---|---|
@@ -1,3 +1,52 @@ | ||
# flake8-markdown | ||
# Flake8 Markdown | ||
|
||
This package lints Python code blocks in Markdown files using [`flake8`](https://flake8.readthedocs.io/en/stable/). | ||
[ | ||
![PyPI](https://img.shields.io/pypi/v/flake8-markdown.svg) | ||
![PyPI](https://img.shields.io/pypi/pyversions/flake8-markdown.svg) | ||
![PyPI](https://img.shields.io/pypi/l/flake8-markdown.svg) | ||
](https://pypi.org/project/flake8-markdown/) | ||
[![TravisCI](https://travis-ci.org/johnfraney/flake8-markdown.svg?branch=master)](https://travis-ci.org/johnfraney/flake8-markdown) | ||
|
||
Flake8 Markdown lints [GitHub-style Python code blocks](https://help.github.com/en/articles/creating-and-highlighting-code-blocks#fenced-code-blocks) in Markdown files using [`flake8`](https://flake8.readthedocs.io/en/stable/). | ||
|
||
This package helps improve a Python project's documentation by ensuring that code samples are error-free. | ||
|
||
## Usage | ||
|
||
### CLI | ||
|
||
You can use Flake8 Markdown as a CLI tool using the `flake8-markdown` command. | ||
|
||
`flake8-markdown` accepts one or more [globs](https://docs.python.org/3.7/library/glob.html) as its arguments. | ||
|
||
Example: | ||
|
||
```console | ||
$ flake8-markdown flake8-markdown "tests/samples/*.md" | ||
tests/samples/emphasized_lines.md:6:1: F821 undefined name 'emphasized_imaginary_function' | ||
tests/samples/basic.md:8:48: E999 SyntaxError: EOL while scanning string literal | ||
tests/samples/basic.md:14:7: F821 undefined name 'undefined_variable' | ||
``` | ||
|
||
### pre-commit hook | ||
|
||
You can also add `flake8-markdown` to your project using [pre-commit](https://pre-commit.com/). When configured, any staged Markdown files will be linted using `flake8-markdown` once you run `git commit`. | ||
|
||
To enable this hook in your local repository, add the following `repo` to your `.pre-commit-config.yaml` file: | ||
|
||
```yaml | ||
# .pre-commit-config.yaml | ||
repos: | ||
- repo: https://github.com/johnfraney/flake8-markdown | ||
rev: latest | ||
hooks: | ||
- id: flake8-markdown | ||
``` | ||
|
||
## History | ||
|
||
### [0.1.0] - 2019-05-19 | ||
|
||
#### Added | ||
|
||
- Added code for initial release |
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,16 @@ | ||
import subprocess | ||
import sys | ||
|
||
|
||
if sys.version_info.major == 3 and sys.version_info.minor >= 7: | ||
SUBPROCESS_ARGS = dict( | ||
capture_output=True, | ||
text=True, | ||
) | ||
else: | ||
SUBPROCESS_ARGS = dict( | ||
encoding='ascii', | ||
universal_newlines=True, | ||
stderr=subprocess.PIPE, | ||
stdout=subprocess.PIPE, | ||
) |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.