flake8-markdown


Nameflake8-markdown JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/johnfraney/flake8-markdown
SummaryLints Python code blocks in Markdown files using flake8
upload_time2024-12-04 15:00:59
maintainerNone
docs_urlNone
authorJohn Franey
requires_python>=3.9
licenseMIT
keywords flake8 markdown lint
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/johnfraney/flake8-markdown.svg)
](https://pypi.org/project/flake8-markdown/)
[![Tox](https://github.com/johnfraney/flake8-markdown/actions/workflows/github-actions-tox.yml/badge.svg)](https://github.com/johnfraney/flake8-markdown/actions/workflows/github-actions-tox.yml)

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:

```shell
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 "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: v0.5.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.5.0] - 2023-09-04

#### Added

- Added CI for `python` 3.11
- Added funding file

#### Removed

- Dropped support for `python` 3.7 and Pypy 3

### [0.4.0] - 2022-09-11

#### Added

- Added support for `flake8` v5
- Added support for `python` 3.10

#### Removed

- Dropped support for `python` 3.6

### [0.3.0] - 2021-10-19

#### Added

- Added support for `flake8` v4

### [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


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/johnfraney/flake8-markdown",
    "name": "flake8-markdown",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "flake8, markdown, lint",
    "author": "John Franey",
    "author_email": "johnfraney@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/91/b9/419275fdeb2df233430dcc166956ea521e46e595cbd106b44a4ae4c8574b/flake8_markdown-0.6.0.tar.gz",
    "platform": null,
    "description": "# Flake8 Markdown\n\n[\n![PyPI](https://img.shields.io/pypi/v/flake8-markdown.svg)\n![PyPI](https://img.shields.io/pypi/pyversions/flake8-markdown.svg)\n![PyPI](https://img.shields.io/github/license/johnfraney/flake8-markdown.svg)\n](https://pypi.org/project/flake8-markdown/)\n[![Tox](https://github.com/johnfraney/flake8-markdown/actions/workflows/github-actions-tox.yml/badge.svg)](https://github.com/johnfraney/flake8-markdown/actions/workflows/github-actions-tox.yml)\n\nFlake8 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/).\n\nThis package helps improve a Python project's documentation by ensuring that code samples are error-free.\n\n## Features\n\n- Lints code blocks containing regular Python and Python interpreter code ([`pycon`](http://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer))\n- [pre-commit](#pre-commit-hook) hook to lint on commit\n\n## Installation\n\nFlake8 Markdown can be installed from PyPI using `pip` or your package manager of choice:\n\n```shell\npip install flake8-markdown\n```\n\n## Usage\n\n### CLI\n\nYou can use Flake8 Markdown as a CLI tool using the `flake8-markdown` command.\n\n`flake8-markdown` accepts one or more [globs](https://docs.python.org/3.7/library/glob.html) as its arguments.\n\nExample:\n\n```console\n$ flake8-markdown \"tests/samples/*.md\"\ntests/samples/emphasized_lines.md:6:1: F821 undefined name 'emphasized_imaginary_function'\ntests/samples/basic.md:8:48: E999 SyntaxError: EOL while scanning string literal\ntests/samples/basic.md:14:7: F821 undefined name 'undefined_variable'\n```\n\n### pre-commit hook\n\nYou 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`.\n\nTo enable this hook in your local repository, add the following `repo` to your `.pre-commit-config.yaml` file:\n\n```yaml\n# .pre-commit-config.yaml\nrepos:\n  - repo: https://github.com/johnfraney/flake8-markdown\n    rev: v0.5.0\n    hooks:\n      - id: flake8-markdown\n```\n\n## Code of Conduct\n\nEveryone 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/).\n\n## History\n\n### [0.5.0] - 2023-09-04\n\n#### Added\n\n- Added CI for `python` 3.11\n- Added funding file\n\n#### Removed\n\n- Dropped support for `python` 3.7 and Pypy 3\n\n### [0.4.0] - 2022-09-11\n\n#### Added\n\n- Added support for `flake8` v5\n- Added support for `python` 3.10\n\n#### Removed\n\n- Dropped support for `python` 3.6\n\n### [0.3.0] - 2021-10-19\n\n#### Added\n\n- Added support for `flake8` v4\n\n### [0.2.0] - 2019-06-14\n\n#### Added\n\n- [`pycon`](http://pygments.org/docs/lexers/#pygments.lexers.python.PythonConsoleLexer) code block support\n\n### [0.1.1] - 2019-05-19\n\n#### Changed\n\n- Fixed pre-commit example in README\n\n### [0.1.0] - 2019-05-19\n\n#### Added\n\n- Added code for initial release\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Lints Python code blocks in Markdown files using flake8",
    "version": "0.6.0",
    "project_urls": {
        "Homepage": "https://github.com/johnfraney/flake8-markdown",
        "Repository": "https://github.com/johnfraney/flake8-markdown"
    },
    "split_keywords": [
        "flake8",
        " markdown",
        " lint"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f95d2b8cec55b51be724945a9046c428140db7685fb7b49ac3fe2fd87f20a60c",
                "md5": "dad3d4fe7a86e224ae23e21929d2d02f",
                "sha256": "4aaca329a5322aeace9e1bfdb3e0bb4c0c05cc611a7f4106a467dcb4e0224454"
            },
            "downloads": -1,
            "filename": "flake8_markdown-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dad3d4fe7a86e224ae23e21929d2d02f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6421,
            "upload_time": "2024-12-04T15:00:57",
            "upload_time_iso_8601": "2024-12-04T15:00:57.961864Z",
            "url": "https://files.pythonhosted.org/packages/f9/5d/2b8cec55b51be724945a9046c428140db7685fb7b49ac3fe2fd87f20a60c/flake8_markdown-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91b9419275fdeb2df233430dcc166956ea521e46e595cbd106b44a4ae4c8574b",
                "md5": "88de0ee5ae8bb23d9b5eebe5906fec6c",
                "sha256": "69d2a3d650ad6e995885c46c96963939eb28bd08f1832714ad09717b58848059"
            },
            "downloads": -1,
            "filename": "flake8_markdown-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "88de0ee5ae8bb23d9b5eebe5906fec6c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 4553,
            "upload_time": "2024-12-04T15:00:59",
            "upload_time_iso_8601": "2024-12-04T15:00:59.724620Z",
            "url": "https://files.pythonhosted.org/packages/91/b9/419275fdeb2df233430dcc166956ea521e46e595cbd106b44a4ae4c8574b/flake8_markdown-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-04 15:00:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "johnfraney",
    "github_project": "flake8-markdown",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "flake8-markdown"
}
        
Elapsed time: 0.41398s