-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1bd0866
Showing
7 changed files
with
136 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
dist: xenial # required for Python >= 3.4 | ||
language: python | ||
cache: pip | ||
matrix: | ||
include: | ||
- name: "3.4" | ||
python: 3.4 | ||
- 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,3 @@ | ||
{ | ||
"restructuredtext.confPath": "" | ||
} |
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,81 @@ | ||
# Flake8 Markdown | ||
|
||
[ | ||
![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/github/license/guinslym/flake8-markdown.svg) | ||
](https://pypi.org/project/flake8-markdown/) | ||
[![TravisCI](https://travis-ci.org/guinslym/flake8-markdown.svg?branch=master)](https://travis-ci.org/guinslym/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. | ||
|
||
## Features | ||
|
||
- Lints code blocks containing regular Python and Python interpreter code ([`pycon`](http://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer)) | ||
- [pre-commit](#pre-commit-hook) hook to lint on commit | ||
|
||
## Installation | ||
|
||
Flake8 Markdown can be installed from PyPI using `pip` or your package manager of choice: | ||
|
||
``` | ||
pip install flake8-markdown | ||
``` | ||
|
||
## 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/guinslym/flake8-markdown | ||
rev: v0.2.0 | ||
hooks: | ||
- id: flake8-markdown | ||
``` | ||
## Code of Conduct | ||
Everyone interacting in the project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/). | ||
## History | ||
## [0.2.0] - 2019-06-14 | ||
### Added | ||
- [`pycon`](http://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer) code block support | ||
|
||
### [0.1.1] - 2019-05-19 | ||
|
||
#### Changed | ||
|
||
- Fixed pre-commit example in README | ||
|
||
### [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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = '0.1.0' |
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,31 @@ | ||
[tool.poetry] | ||
name = "ask_schools" | ||
version = "0.1.1" | ||
description = "Ask Scholars Portal Name Conversion" | ||
authors = ["Guinsly Mondesir <[email protected]>"] | ||
keywords = ["Ask", "Scholars Portal", "Ontario"] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/guinslym/flake8-markdown" | ||
repository = "https://github.com/guinslym/flake8-markdown" | ||
classifiers = [ | ||
"Environment :: Console", | ||
"Framework :: Flake8", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Documentation", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Software Development :: Quality Assurance", | ||
] | ||
include = [ | ||
"LICENSE", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.4" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = "^3.0" | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
build-backend = "poetry.masonry.api" |
Empty file.
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,5 @@ | ||
from ask_schools import __version__ | ||
|
||
|
||
def test_version(): | ||
assert __version__ == '0.1.0' |