├── .bumpversion.cfg ├── .flake8 ├── .github └── workflows │ └── main.yml ├── .gitignore ├── .gitlint ├── .pre-commit-config.yaml ├── .yamllint.yaml ├── LICENSE ├── README.md ├── mdformat_ruff ├── __init__.py └── py.typed ├── poetry.lock ├── pyproject.toml ├── templates ├── class.txt ├── def.txt ├── metainfo.py └── noarg.txt └── tests └── test_mdformat_ruff.py /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | commit = True 3 | tag = True 4 | tag_name = {new_version} 5 | current_version = 0.1.2 6 | 7 | [bumpversion:file:pyproject.toml] 8 | search = version = "{current_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 9 | replace = version = "{new_version}" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 10 | 11 | [bumpversion:file:mdformat_black/__init__.py] 12 | search = __version__ = "{current_version}" 13 | replace = __version__ = "{new_version}" 14 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 88 3 | max-complexity = 10 4 | # These checks violate PEP8 so let's ignore them 5 | extend-ignore = E203 6 | extend-exclude = */site-packages/* 7 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | "on": 3 | push: 4 | paths-ignore: 5 | - "**.md" 6 | - docs/* 7 | pull_request: 8 | paths-ignore: 9 | - "**.md" 10 | - docs/* 11 | workflow_dispatch: 12 | 13 | # https://github.com/softprops/action-gh-release/issues/236 14 | permissions: 15 | contents: write 16 | 17 | env: 18 | PYTHONUTF8: "1" 19 | python-version: 3.x 20 | cache: poetry 21 | 22 | jobs: 23 | test: 24 | strategy: 25 | fail-fast: false 26 | matrix: 27 | runs-on: 28 | - ubuntu-latest 29 | - macos-latest 30 | - windows-latest 31 | runs-on: ${{matrix.runs-on}} 32 | steps: 33 | - uses: actions/checkout@v4 34 | - name: Install dependencies 35 | run: | 36 | pip install poetry 37 | - uses: actions/setup-python@v4 38 | with: 39 | python-version: ${{env.python-version}} 40 | cache: ${{env.cache}} 41 | - name: Install dependencies 42 | run: | 43 | poetry install 44 | - name: Test 45 | run: | 46 | poetry run pytest --cov 47 | - uses: codecov/codecov-action@v3 48 | 49 | build: 50 | needs: test 51 | strategy: 52 | fail-fast: false 53 | matrix: 54 | runs-on: 55 | - ubuntu-latest 56 | - macos-latest 57 | - windows-latest 58 | runs-on: ${{matrix.runs-on}} 59 | steps: 60 | - uses: actions/checkout@v4 61 | - name: Install dependencies 62 | run: | 63 | pip install poetry 64 | - uses: actions/setup-python@v4 65 | with: 66 | python-version: ${{env.python-version}} 67 | cache: ${{env.cache}} 68 | - name: Install dependencies 69 | run: | 70 | pip install build 71 | - name: Build 72 | run: | 73 | pyproject-build 74 | - uses: pypa/gh-action-pypi-publish@release/v1 75 | if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') 76 | with: 77 | password: ${{secrets.PYPI_API_TOKEN}} 78 | - uses: actions/upload-artifact@v3 79 | if: runner.os == 'Linux' && ! startsWith(github.ref, 'refs/tags/') 80 | with: 81 | path: | 82 | dist/* 83 | - uses: softprops/action-gh-release@v1 84 | if: runner.os == 'Linux' && startsWith(github.ref, 'refs/tags/') 85 | with: 86 | # body_path: build/CHANGELOG.md 87 | files: | 88 | dist/* 89 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | # IntelliJ 132 | .idea/ 133 | -------------------------------------------------------------------------------- /.gitlint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S gitlint -C 2 | [ignore-by-title] 3 | regex=.* 4 | ignore=body-is-missing 5 | # ex: filetype=dosini 6 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | exclude: ^templates/.* 3 | 4 | repos: 5 | - repo: https://github.com/pre-commit/pre-commit-hooks 6 | rev: v4.5.0 7 | hooks: 8 | - id: check-added-large-files 9 | - id: fix-byte-order-marker 10 | - id: check-case-conflict 11 | - id: check-shebang-scripts-are-executable 12 | - id: check-merge-conflict 13 | - id: trailing-whitespace 14 | - id: mixed-line-ending 15 | - id: end-of-file-fixer 16 | - id: detect-private-key 17 | - id: check-symlinks 18 | - id: check-ast 19 | - id: debug-statements 20 | - id: requirements-txt-fixer 21 | - id: check-xml 22 | - id: check-yaml 23 | - id: check-toml 24 | - id: check-json 25 | - repo: https://github.com/Lucas-C/pre-commit-hooks 26 | rev: v1.5.4 27 | hooks: 28 | - id: remove-crlf 29 | - repo: https://github.com/codespell-project/codespell 30 | rev: v2.2.6 31 | hooks: 32 | - id: codespell 33 | additional_dependencies: 34 | - tomli 35 | - repo: https://github.com/jorisroovers/gitlint 36 | rev: v0.19.1 37 | hooks: 38 | - id: gitlint 39 | args: 40 | - --msg-filename 41 | - repo: https://github.com/editorconfig-checker/editorconfig-checker.python 42 | rev: 2.7.3 43 | hooks: 44 | - id: editorconfig-checker 45 | - repo: https://github.com/jumanjihouse/pre-commit-hooks 46 | rev: 3.0.0 47 | hooks: 48 | - id: check-mailmap 49 | - repo: https://github.com/rhysd/actionlint 50 | rev: v1.6.26 51 | hooks: 52 | - id: actionlint 53 | - repo: https://github.com/adrienverge/yamllint 54 | rev: v1.33.0 55 | hooks: 56 | - id: yamllint 57 | - repo: https://github.com/executablebooks/mdformat 58 | rev: 0.7.17 59 | hooks: 60 | - id: mdformat 61 | additional_dependencies: 62 | - mdformat-pyproject 63 | - mdformat-gfm 64 | - mdformat-myst 65 | - mdformat-toc 66 | - mdformat-deflist 67 | - mdformat-beautysh 68 | - mdformat-ruff 69 | - mdformat-config 70 | - repo: https://github.com/DavidAnson/markdownlint-cli2 71 | rev: v0.12.1 72 | hooks: 73 | - id: markdownlint-cli2 74 | additional_dependencies: 75 | - markdown-it-texmath 76 | - repo: https://github.com/astral-sh/ruff-pre-commit 77 | rev: v0.1.14 78 | hooks: 79 | - id: ruff 80 | - id: ruff-format 81 | - repo: https://github.com/kumaraditya303/mirrors-pyright 82 | rev: v1.1.348 83 | hooks: 84 | - id: pyright 85 | 86 | ci: 87 | skip: 88 | - pyright 89 | -------------------------------------------------------------------------------- /.yamllint.yaml: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S yamllint -c 2 | --- 3 | extends: default 4 | 5 | rules: 6 | comments: 7 | # https://github.com/prettier/prettier/issues/6780 8 | min-spaces-from-content: 1 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Taneli Hukkinen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mdformat-ruff 2 | 3 | [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/mdformat-ruff/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/mdformat-ruff/main) 4 | [![github/workflow](https://github.com/Freed-Wu/mdformat-ruff/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/mdformat-ruff/actions) 5 | 6 | [![github/downloads](https://shields.io/github/downloads/Freed-Wu/mdformat-ruff/total)](https://github.com/Freed-Wu/mdformat-ruff/releases) 7 | [![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/mdformat-ruff/latest/total)](https://github.com/Freed-Wu/mdformat-ruff/releases/latest) 8 | [![github/issues](https://shields.io/github/issues/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/issues) 9 | [![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/issues?q=is%3Aissue+is%3Aclosed) 10 | [![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/pulls) 11 | [![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/pulls?q=is%3Apr+is%3Aclosed) 12 | [![github/discussions](https://shields.io/github/discussions/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/discussions) 13 | [![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/milestones) 14 | [![github/forks](https://shields.io/github/forks/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/network/members) 15 | [![github/stars](https://shields.io/github/stars/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/stargazers) 16 | [![github/watchers](https://shields.io/github/watchers/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/watchers) 17 | [![github/contributors](https://shields.io/github/contributors/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/graphs/contributors) 18 | [![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/graphs/commit-activity) 19 | [![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/commits) 20 | [![github/release-date](https://shields.io/github/release-date/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/releases/latest) 21 | 22 | [![github/license](https://shields.io/github/license/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff/blob/main/LICENSE) 23 | [![github/languages](https://shields.io/github/languages/count/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 24 | [![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 25 | [![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 26 | [![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 27 | [![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 28 | [![github/v](https://shields.io/github/v/release/Freed-Wu/mdformat-ruff)](https://github.com/Freed-Wu/mdformat-ruff) 29 | 30 | [![pypi/status](https://shields.io/pypi/status/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#description) 31 | [![pypi/v](https://shields.io/pypi/v/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#history) 32 | [![pypi/downloads](https://shields.io/pypi/dd/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#files) 33 | [![pypi/format](https://shields.io/pypi/format/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#files) 34 | [![pypi/implementation](https://shields.io/pypi/implementation/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#files) 35 | [![pypi/pyversions](https://shields.io/pypi/pyversions/mdformat-ruff)](https://pypi.org/project/mdformat-ruff/#files) 36 | 37 | > Mdformat plugin to ruffen Python code blocks 38 | 39 | ## Description 40 | 41 | mdformat-ruff is an [mdformat](https://github.com/executablebooks/mdformat) plugin 42 | that makes mdformat format Python code blocks with [ruff](https://github.com/psf/ruff). 43 | 44 | ## Usage 45 | 46 | Install with: 47 | 48 | ```bash 49 | pip install mdformat-ruff 50 | ``` 51 | 52 | You may pin ruff dependency for formatting stability: 53 | 54 | ```bash 55 | pip install mdformat-ruff ruff==22.1.0 56 | ``` 57 | 58 | When using mdformat on the command line, ruff formatting will be automatically 59 | enabled after install. 60 | 61 | When using mdformat Python API, code formatting for Python will have to be 62 | enabled explicitly: 63 | 64 | ````python 65 | import mdformat 66 | 67 | unformatted = "```python\n'''ruff converts quotes'''\n```\n" 68 | formatted = mdformat.text(unformatted, codeformatters={"python"}) 69 | assert formatted == '```python\n"""ruff converts quotes"""\n```\n' 70 | ```` 71 | 72 | ## Usage as a [pre-commit](https://pre-commit.com) hook 73 | 74 | Add the following to your `.pre-commit-config.yaml`: 75 | 76 | ```yaml 77 | - repo: https://github.com/executablebooks/mdformat 78 | rev: 0.7.13 # Use the ref you want to point at 79 | hooks: 80 | - id: mdformat 81 | additional_dependencies: 82 | - mdformat-ruff 83 | - ruff==22.1.0 # Pinning ruff here is optional 84 | ``` 85 | -------------------------------------------------------------------------------- /mdformat_ruff/__init__.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | from ruff.__main__ import find_ruff_bin 4 | 5 | __version__ = ( 6 | "0.1.3" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 7 | ) 8 | 9 | 10 | def format_python(unformatted: str, _info_str: str) -> str: 11 | r"""Format python. 12 | 13 | :param unformatted: 14 | :type unformatted: str 15 | :param _info_str: 16 | :type _info_str: str 17 | :rtype: str 18 | """ 19 | return subprocess.check_output( 20 | [find_ruff_bin(), "format", "-"], 21 | input=unformatted.encode(), 22 | stderr=subprocess.DEVNULL, 23 | ).decode() 24 | -------------------------------------------------------------------------------- /mdformat_ruff/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Freed-Wu/mdformat-ruff/c4f4c6c79eae92136c6f1c8a105f76f9b0136018/mdformat_ruff/py.typed -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. 2 | 3 | [[package]] 4 | name = "colorama" 5 | version = "0.4.6" 6 | description = "Cross-platform colored terminal text." 7 | optional = false 8 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" 9 | files = [ 10 | {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, 11 | {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, 12 | ] 13 | 14 | [[package]] 15 | name = "coverage" 16 | version = "7.2.7" 17 | description = "Code coverage measurement for Python" 18 | optional = false 19 | python-versions = ">=3.7" 20 | files = [ 21 | {file = "coverage-7.2.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d39b5b4f2a66ccae8b7263ac3c8170994b65266797fb96cbbfd3fb5b23921db8"}, 22 | {file = "coverage-7.2.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6d040ef7c9859bb11dfeb056ff5b3872436e3b5e401817d87a31e1750b9ae2fb"}, 23 | {file = "coverage-7.2.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ba90a9563ba44a72fda2e85302c3abc71c5589cea608ca16c22b9804262aaeb6"}, 24 | {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e7d9405291c6928619403db1d10bd07888888ec1abcbd9748fdaa971d7d661b2"}, 25 | {file = "coverage-7.2.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:31563e97dae5598556600466ad9beea39fb04e0229e61c12eaa206e0aa202063"}, 26 | {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ebba1cd308ef115925421d3e6a586e655ca5a77b5bf41e02eb0e4562a111f2d1"}, 27 | {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:cb017fd1b2603ef59e374ba2063f593abe0fc45f2ad9abdde5b4d83bd922a353"}, 28 | {file = "coverage-7.2.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d62a5c7dad11015c66fbb9d881bc4caa5b12f16292f857842d9d1871595f4495"}, 29 | {file = "coverage-7.2.7-cp310-cp310-win32.whl", hash = "sha256:ee57190f24fba796e36bb6d3aa8a8783c643d8fa9760c89f7a98ab5455fbf818"}, 30 | {file = "coverage-7.2.7-cp310-cp310-win_amd64.whl", hash = "sha256:f75f7168ab25dd93110c8a8117a22450c19976afbc44234cbf71481094c1b850"}, 31 | {file = "coverage-7.2.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:06a9a2be0b5b576c3f18f1a241f0473575c4a26021b52b2a85263a00f034d51f"}, 32 | {file = "coverage-7.2.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5baa06420f837184130752b7c5ea0808762083bf3487b5038d68b012e5937dbe"}, 33 | {file = "coverage-7.2.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fdec9e8cbf13a5bf63290fc6013d216a4c7232efb51548594ca3631a7f13c3a3"}, 34 | {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:52edc1a60c0d34afa421c9c37078817b2e67a392cab17d97283b64c5833f427f"}, 35 | {file = "coverage-7.2.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63426706118b7f5cf6bb6c895dc215d8a418d5952544042c8a2d9fe87fcf09cb"}, 36 | {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:afb17f84d56068a7c29f5fa37bfd38d5aba69e3304af08ee94da8ed5b0865833"}, 37 | {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:48c19d2159d433ccc99e729ceae7d5293fbffa0bdb94952d3579983d1c8c9d97"}, 38 | {file = "coverage-7.2.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e1f928eaf5469c11e886fe0885ad2bf1ec606434e79842a879277895a50942a"}, 39 | {file = "coverage-7.2.7-cp311-cp311-win32.whl", hash = "sha256:33d6d3ea29d5b3a1a632b3c4e4f4ecae24ef170b0b9ee493883f2df10039959a"}, 40 | {file = "coverage-7.2.7-cp311-cp311-win_amd64.whl", hash = "sha256:5b7540161790b2f28143191f5f8ec02fb132660ff175b7747b95dcb77ac26562"}, 41 | {file = "coverage-7.2.7-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:f2f67fe12b22cd130d34d0ef79206061bfb5eda52feb6ce0dba0644e20a03cf4"}, 42 | {file = "coverage-7.2.7-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a342242fe22407f3c17f4b499276a02b01e80f861f1682ad1d95b04018e0c0d4"}, 43 | {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:171717c7cb6b453aebac9a2ef603699da237f341b38eebfee9be75d27dc38e01"}, 44 | {file = "coverage-7.2.7-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49969a9f7ffa086d973d91cec8d2e31080436ef0fb4a359cae927e742abfaaa6"}, 45 | {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b46517c02ccd08092f4fa99f24c3b83d8f92f739b4657b0f146246a0ca6a831d"}, 46 | {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:a3d33a6b3eae87ceaefa91ffdc130b5e8536182cd6dfdbfc1aa56b46ff8c86de"}, 47 | {file = "coverage-7.2.7-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:976b9c42fb2a43ebf304fa7d4a310e5f16cc99992f33eced91ef6f908bd8f33d"}, 48 | {file = "coverage-7.2.7-cp312-cp312-win32.whl", hash = "sha256:8de8bb0e5ad103888d65abef8bca41ab93721647590a3f740100cd65c3b00511"}, 49 | {file = "coverage-7.2.7-cp312-cp312-win_amd64.whl", hash = "sha256:9e31cb64d7de6b6f09702bb27c02d1904b3aebfca610c12772452c4e6c21a0d3"}, 50 | {file = "coverage-7.2.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58c2ccc2f00ecb51253cbe5d8d7122a34590fac9646a960d1430d5b15321d95f"}, 51 | {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d22656368f0e6189e24722214ed8d66b8022db19d182927b9a248a2a8a2f67eb"}, 52 | {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a895fcc7b15c3fc72beb43cdcbdf0ddb7d2ebc959edac9cef390b0d14f39f8a9"}, 53 | {file = "coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e84606b74eb7de6ff581a7915e2dab7a28a0517fbe1c9239eb227e1354064dcd"}, 54 | {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:0a5f9e1dbd7fbe30196578ca36f3fba75376fb99888c395c5880b355e2875f8a"}, 55 | {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:419bfd2caae268623dd469eff96d510a920c90928b60f2073d79f8fe2bbc5959"}, 56 | {file = "coverage-7.2.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:2aee274c46590717f38ae5e4650988d1af340fe06167546cc32fe2f58ed05b02"}, 57 | {file = "coverage-7.2.7-cp37-cp37m-win32.whl", hash = "sha256:61b9a528fb348373c433e8966535074b802c7a5d7f23c4f421e6c6e2f1697a6f"}, 58 | {file = "coverage-7.2.7-cp37-cp37m-win_amd64.whl", hash = "sha256:b1c546aca0ca4d028901d825015dc8e4d56aac4b541877690eb76490f1dc8ed0"}, 59 | {file = "coverage-7.2.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:54b896376ab563bd38453cecb813c295cf347cf5906e8b41d340b0321a5433e5"}, 60 | {file = "coverage-7.2.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3d376df58cc111dc8e21e3b6e24606b5bb5dee6024f46a5abca99124b2229ef5"}, 61 | {file = "coverage-7.2.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5e330fc79bd7207e46c7d7fd2bb4af2963f5f635703925543a70b99574b0fea9"}, 62 | {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1e9d683426464e4a252bf70c3498756055016f99ddaec3774bf368e76bbe02b6"}, 63 | {file = "coverage-7.2.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d13c64ee2d33eccf7437961b6ea7ad8673e2be040b4f7fd4fd4d4d28d9ccb1e"}, 64 | {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7aa5f8a41217360e600da646004f878250a0d6738bcdc11a0a39928d7dc2050"}, 65 | {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8fa03bce9bfbeeef9f3b160a8bed39a221d82308b4152b27d82d8daa7041fee5"}, 66 | {file = "coverage-7.2.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:245167dd26180ab4c91d5e1496a30be4cd721a5cf2abf52974f965f10f11419f"}, 67 | {file = "coverage-7.2.7-cp38-cp38-win32.whl", hash = "sha256:d2c2db7fd82e9b72937969bceac4d6ca89660db0a0967614ce2481e81a0b771e"}, 68 | {file = "coverage-7.2.7-cp38-cp38-win_amd64.whl", hash = "sha256:2e07b54284e381531c87f785f613b833569c14ecacdcb85d56b25c4622c16c3c"}, 69 | {file = "coverage-7.2.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:537891ae8ce59ef63d0123f7ac9e2ae0fc8b72c7ccbe5296fec45fd68967b6c9"}, 70 | {file = "coverage-7.2.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:06fb182e69f33f6cd1d39a6c597294cff3143554b64b9825d1dc69d18cc2fff2"}, 71 | {file = "coverage-7.2.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:201e7389591af40950a6480bd9edfa8ed04346ff80002cec1a66cac4549c1ad7"}, 72 | {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f6951407391b639504e3b3be51b7ba5f3528adbf1a8ac3302b687ecababf929e"}, 73 | {file = "coverage-7.2.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f48351d66575f535669306aa7d6d6f71bc43372473b54a832222803eb956fd1"}, 74 | {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b29019c76039dc3c0fd815c41392a044ce555d9bcdd38b0fb60fb4cd8e475ba9"}, 75 | {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:81c13a1fc7468c40f13420732805a4c38a105d89848b7c10af65a90beff25250"}, 76 | {file = "coverage-7.2.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:975d70ab7e3c80a3fe86001d8751f6778905ec723f5b110aed1e450da9d4b7f2"}, 77 | {file = "coverage-7.2.7-cp39-cp39-win32.whl", hash = "sha256:7ee7d9d4822c8acc74a5e26c50604dff824710bc8de424904c0982e25c39c6cb"}, 78 | {file = "coverage-7.2.7-cp39-cp39-win_amd64.whl", hash = "sha256:eb393e5ebc85245347950143969b241d08b52b88a3dc39479822e073a1a8eb27"}, 79 | {file = "coverage-7.2.7-pp37.pp38.pp39-none-any.whl", hash = "sha256:b7b4c971f05e6ae490fef852c218b0e79d4e52f79ef0c8475566584a8fb3e01d"}, 80 | {file = "coverage-7.2.7.tar.gz", hash = "sha256:924d94291ca674905fe9481f12294eb11f2d3d3fd1adb20314ba89e94f44ed59"}, 81 | ] 82 | 83 | [package.dependencies] 84 | tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} 85 | 86 | [package.extras] 87 | toml = ["tomli"] 88 | 89 | [[package]] 90 | name = "exceptiongroup" 91 | version = "1.2.0" 92 | description = "Backport of PEP 654 (exception groups)" 93 | optional = false 94 | python-versions = ">=3.7" 95 | files = [ 96 | {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, 97 | {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, 98 | ] 99 | 100 | [package.extras] 101 | test = ["pytest (>=6)"] 102 | 103 | [[package]] 104 | name = "importlib-metadata" 105 | version = "6.7.0" 106 | description = "Read metadata from Python packages" 107 | optional = false 108 | python-versions = ">=3.7" 109 | files = [ 110 | {file = "importlib_metadata-6.7.0-py3-none-any.whl", hash = "sha256:cb52082e659e97afc5dac71e79de97d8681de3aa07ff18578330904a9d18e5b5"}, 111 | {file = "importlib_metadata-6.7.0.tar.gz", hash = "sha256:1aaf550d4f73e5d6783e7acb77aec43d49da8017410afae93822cc9cca98c4d4"}, 112 | ] 113 | 114 | [package.dependencies] 115 | typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} 116 | zipp = ">=0.5" 117 | 118 | [package.extras] 119 | docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] 120 | perf = ["ipython"] 121 | testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] 122 | 123 | [[package]] 124 | name = "iniconfig" 125 | version = "2.0.0" 126 | description = "brain-dead simple config-ini parsing" 127 | optional = false 128 | python-versions = ">=3.7" 129 | files = [ 130 | {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, 131 | {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, 132 | ] 133 | 134 | [[package]] 135 | name = "markdown-it-py" 136 | version = "2.2.0" 137 | description = "Python port of markdown-it. Markdown parsing, done right!" 138 | optional = false 139 | python-versions = ">=3.7" 140 | files = [ 141 | {file = "markdown-it-py-2.2.0.tar.gz", hash = "sha256:7c9a5e412688bc771c67432cbfebcdd686c93ce6484913dccf06cb5a0bea35a1"}, 142 | {file = "markdown_it_py-2.2.0-py3-none-any.whl", hash = "sha256:5a35f8d1870171d9acc47b99612dc146129b631baf04970128b568f190d0cc30"}, 143 | ] 144 | 145 | [package.dependencies] 146 | mdurl = ">=0.1,<1.0" 147 | typing_extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} 148 | 149 | [package.extras] 150 | benchmarking = ["psutil", "pytest", "pytest-benchmark"] 151 | code-style = ["pre-commit (>=3.0,<4.0)"] 152 | compare = ["commonmark (>=0.9,<1.0)", "markdown (>=3.4,<4.0)", "mistletoe (>=1.0,<2.0)", "mistune (>=2.0,<3.0)", "panflute (>=2.3,<3.0)"] 153 | linkify = ["linkify-it-py (>=1,<3)"] 154 | plugins = ["mdit-py-plugins"] 155 | profiling = ["gprof2dot"] 156 | rtd = ["attrs", "myst-parser", "pyyaml", "sphinx", "sphinx-copybutton", "sphinx-design", "sphinx_book_theme"] 157 | testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] 158 | 159 | [[package]] 160 | name = "mdformat" 161 | version = "0.7.16" 162 | description = "CommonMark compliant Markdown formatter" 163 | optional = false 164 | python-versions = ">=3.7" 165 | files = [ 166 | {file = "mdformat-0.7.16-py3-none-any.whl", hash = "sha256:76398d03baa394f331fb560fd0aed8257cf77b65b1c8146b92d395af16253662"}, 167 | {file = "mdformat-0.7.16.tar.gz", hash = "sha256:99b105033207d2ab70ba1ced8e07327ed4ef1e0a6bc1c7c00207ea73ab502782"}, 168 | ] 169 | 170 | [package.dependencies] 171 | importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""} 172 | markdown-it-py = ">=1.0.0,<3.0.0" 173 | tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} 174 | typing-extensions = {version = ">=3.7.4", markers = "python_version < \"3.8\""} 175 | 176 | [[package]] 177 | name = "mdurl" 178 | version = "0.1.2" 179 | description = "Markdown URL utilities" 180 | optional = false 181 | python-versions = ">=3.7" 182 | files = [ 183 | {file = "mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8"}, 184 | {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, 185 | ] 186 | 187 | [[package]] 188 | name = "packaging" 189 | version = "23.2" 190 | description = "Core utilities for Python packages" 191 | optional = false 192 | python-versions = ">=3.7" 193 | files = [ 194 | {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, 195 | {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, 196 | ] 197 | 198 | [[package]] 199 | name = "pluggy" 200 | version = "1.2.0" 201 | description = "plugin and hook calling mechanisms for python" 202 | optional = false 203 | python-versions = ">=3.7" 204 | files = [ 205 | {file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"}, 206 | {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, 207 | ] 208 | 209 | [package.dependencies] 210 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 211 | 212 | [package.extras] 213 | dev = ["pre-commit", "tox"] 214 | testing = ["pytest", "pytest-benchmark"] 215 | 216 | [[package]] 217 | name = "pytest" 218 | version = "7.4.4" 219 | description = "pytest: simple powerful testing with Python" 220 | optional = false 221 | python-versions = ">=3.7" 222 | files = [ 223 | {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, 224 | {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, 225 | ] 226 | 227 | [package.dependencies] 228 | colorama = {version = "*", markers = "sys_platform == \"win32\""} 229 | exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} 230 | importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} 231 | iniconfig = "*" 232 | packaging = "*" 233 | pluggy = ">=0.12,<2.0" 234 | tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} 235 | 236 | [package.extras] 237 | testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] 238 | 239 | [[package]] 240 | name = "pytest-cov" 241 | version = "4.1.0" 242 | description = "Pytest plugin for measuring coverage." 243 | optional = false 244 | python-versions = ">=3.7" 245 | files = [ 246 | {file = "pytest-cov-4.1.0.tar.gz", hash = "sha256:3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6"}, 247 | {file = "pytest_cov-4.1.0-py3-none-any.whl", hash = "sha256:6ba70b9e97e69fcc3fb45bfeab2d0a138fb65c4d0d6a41ef33983ad114be8c3a"}, 248 | ] 249 | 250 | [package.dependencies] 251 | coverage = {version = ">=5.2.1", extras = ["toml"]} 252 | pytest = ">=4.6" 253 | 254 | [package.extras] 255 | testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] 256 | 257 | [[package]] 258 | name = "ruff" 259 | version = "0.2.1" 260 | description = "An extremely fast Python linter and code formatter, written in Rust." 261 | optional = false 262 | python-versions = ">=3.7" 263 | files = [ 264 | {file = "ruff-0.2.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:dd81b911d28925e7e8b323e8d06951554655021df8dd4ac3045d7212ac4ba080"}, 265 | {file = "ruff-0.2.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:dc586724a95b7d980aa17f671e173df00f0a2eef23f8babbeee663229a938fec"}, 266 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c92db7101ef5bfc18e96777ed7bc7c822d545fa5977e90a585accac43d22f18a"}, 267 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:13471684694d41ae0f1e8e3a7497e14cd57ccb7dd72ae08d56a159d6c9c3e30e"}, 268 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a11567e20ea39d1f51aebd778685582d4c56ccb082c1161ffc10f79bebe6df35"}, 269 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:00a818e2db63659570403e44383ab03c529c2b9678ba4ba6c105af7854008105"}, 270 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be60592f9d218b52f03384d1325efa9d3b41e4c4d55ea022cd548547cc42cd2b"}, 271 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbd2288890b88e8aab4499e55148805b58ec711053588cc2f0196a44f6e3d855"}, 272 | {file = "ruff-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3ef052283da7dec1987bba8d8733051c2325654641dfe5877a4022108098683"}, 273 | {file = "ruff-0.2.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7022d66366d6fded4ba3889f73cd791c2d5621b2ccf34befc752cb0df70f5fad"}, 274 | {file = "ruff-0.2.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:0a725823cb2a3f08ee743a534cb6935727d9e47409e4ad72c10a3faf042ad5ba"}, 275 | {file = "ruff-0.2.1-py3-none-musllinux_1_2_i686.whl", hash = "sha256:0034d5b6323e6e8fe91b2a1e55b02d92d0b582d2953a2b37a67a2d7dedbb7acc"}, 276 | {file = "ruff-0.2.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e5cb5526d69bb9143c2e4d2a115d08ffca3d8e0fddc84925a7b54931c96f5c02"}, 277 | {file = "ruff-0.2.1-py3-none-win32.whl", hash = "sha256:6b95ac9ce49b4fb390634d46d6ece32ace3acdd52814671ccaf20b7f60adb232"}, 278 | {file = "ruff-0.2.1-py3-none-win_amd64.whl", hash = "sha256:e3affdcbc2afb6f5bd0eb3130139ceedc5e3f28d206fe49f63073cb9e65988e0"}, 279 | {file = "ruff-0.2.1-py3-none-win_arm64.whl", hash = "sha256:efababa8e12330aa94a53e90a81eb6e2d55f348bc2e71adbf17d9cad23c03ee6"}, 280 | {file = "ruff-0.2.1.tar.gz", hash = "sha256:3b42b5d8677cd0c72b99fcaf068ffc62abb5a19e71b4a3b9cfa50658a0af02f1"}, 281 | ] 282 | 283 | [[package]] 284 | name = "tomli" 285 | version = "2.0.1" 286 | description = "A lil' TOML parser" 287 | optional = false 288 | python-versions = ">=3.7" 289 | files = [ 290 | {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, 291 | {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, 292 | ] 293 | 294 | [[package]] 295 | name = "typing-extensions" 296 | version = "4.7.1" 297 | description = "Backported and Experimental Type Hints for Python 3.7+" 298 | optional = false 299 | python-versions = ">=3.7" 300 | files = [ 301 | {file = "typing_extensions-4.7.1-py3-none-any.whl", hash = "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36"}, 302 | {file = "typing_extensions-4.7.1.tar.gz", hash = "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2"}, 303 | ] 304 | 305 | [[package]] 306 | name = "zipp" 307 | version = "3.15.0" 308 | description = "Backport of pathlib-compatible object wrapper for zip files" 309 | optional = false 310 | python-versions = ">=3.7" 311 | files = [ 312 | {file = "zipp-3.15.0-py3-none-any.whl", hash = "sha256:48904fc76a60e542af151aded95726c1a5c34ed43ab4134b597665c86d7ad556"}, 313 | {file = "zipp-3.15.0.tar.gz", hash = "sha256:112929ad649da941c23de50f356a2b5570c954b65150642bccdd66bf194d224b"}, 314 | ] 315 | 316 | [package.extras] 317 | docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] 318 | testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] 319 | 320 | [metadata] 321 | lock-version = "2.0" 322 | python-versions = "^3.7" 323 | content-hash = "e9238646222c5f0822482f90b09d18f31b38faeb9204686727c6213717acc105" 324 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["poetry-core"] 3 | build-backend = "poetry.core.masonry.api" 4 | 5 | [tool.poetry] 6 | name = "mdformat-ruff" 7 | version = "0.1.3" # DO NOT EDIT THIS LINE MANUALLY. LET bump2version UTILITY DO IT 8 | authors = ["Wu Zhenyu "] 9 | description = "Mdformat plugin to ruffen Python code blocks" 10 | repository = "https://github.com/Freed-Wu/mdformat-ruff" 11 | readme = "README.md" 12 | license = "MIT" 13 | classifiers = [ 14 | "Topic :: Documentation", 15 | "Topic :: Text Processing :: Markup", 16 | "Typing :: Typed", 17 | ] 18 | keywords = ["mdformat", "markdown", "commonmark", "formatter"] 19 | 20 | packages = [{ include = "mdformat_ruff" }] 21 | include = ["mdformat_ruff/py.typed"] 22 | 23 | [tool.poetry.urls] 24 | Homepage = "https://mdformat-ruff.readthedocs.io" 25 | Download = "https://github.com/Freed-Wu/mdformat-ruff/releases" 26 | "Bug Report" = "https://github.com/Freed-Wu/mdformat-ruff/issues" 27 | Source = "https://github.com/Freed-Wu/mdformat-ruff" 28 | 29 | [tool.poetry.plugins."mdformat.codeformatter"] 30 | "python" = "mdformat_ruff:format_python" 31 | 32 | [tool.poetry.dependencies] 33 | python = ">=3.7" 34 | ruff = "*" 35 | 36 | [tool.poetry.group.dev.dependencies] 37 | # Tests 38 | pytest-cov = "*" 39 | mdformat = "*" 40 | 41 | [tool.mdformat] 42 | number = true 43 | 44 | [tool.doq] 45 | template_path = "templates" 46 | 47 | [tool.ruff] 48 | line-length = 79 49 | 50 | [tool.ruff.lint] 51 | select = [ 52 | # pycodestyle 53 | "E", 54 | # pyflakes 55 | "F", 56 | # pyupgrade 57 | "UP", 58 | # flake8-bugbear 59 | "B", 60 | # flake8-simplify 61 | "SIM", 62 | # isort 63 | "I", 64 | ] 65 | ignore = ["D205", "D400"] 66 | preview = true 67 | 68 | [tool.ruff.format] 69 | docstring-code-format = true 70 | preview = true 71 | 72 | [tool.coverage.report] 73 | exclude_lines = [ 74 | "if TYPE_CHECKING:", 75 | "if __name__ == .__main__.:", 76 | "\\s*import tomli as tomllib", 77 | ] 78 | -------------------------------------------------------------------------------- /templates/class.txt: -------------------------------------------------------------------------------- 1 | r"""{{name.replace("_", " ").strip().capitalize()}}.""" 2 | 3 | -------------------------------------------------------------------------------- /templates/def.txt: -------------------------------------------------------------------------------- 1 | r"""{{name.replace("_", " ").strip().capitalize()}}. 2 | 3 | {%for p in params-%} 4 | :param {{p.argument}}: 5 | {%if p.annotation-%} 6 | :type {{p.argument}}: {{p.annotation.strip('"')}} 7 | {%endif-%} 8 | {%endfor-%} 9 | {%if return_type-%} 10 | :rtype: {{return_type}} 11 | {%endif-%} 12 | """ 13 | -------------------------------------------------------------------------------- /templates/metainfo.py: -------------------------------------------------------------------------------- 1 | """This file is generated by scikit-build.generate. 2 | The information comes from pyproject.toml. 3 | It provide some metainfo for docs/conf.py to build documents and 4 | help2man to build man pages. 5 | """ 6 | from datetime import datetime 7 | 8 | # For docs/conf.py 9 | project = "$name" 10 | author = "\n".join(f"{a[0]} <{a[1]}>" for a in $authors) 11 | copyright = datetime.now().year 12 | 13 | # For help2man 14 | DESCRIPTION = "$description" 15 | EPILOG = "Report bugs to " + $urls["Bug Report"] 16 | VERSION = f"""$name $version 17 | Copyright (C) {copyright} 18 | Written by {author}""" 19 | -------------------------------------------------------------------------------- /templates/noarg.txt: -------------------------------------------------------------------------------- 1 | r"""{{name.replace("_", " ").strip().capitalize()}}.""" 2 | -------------------------------------------------------------------------------- /tests/test_mdformat_ruff.py: -------------------------------------------------------------------------------- 1 | import mdformat 2 | 3 | import mdformat_ruff 4 | 5 | 6 | def test_format_python(): 7 | r"""Test format python.""" 8 | assert mdformat_ruff.format_python("print(\n''\n)", "") == 'print("")\n' 9 | 10 | 11 | def test_mdformat_integration(): 12 | r"""Test mdformat integration.""" 13 | unformatted_md = """~~~python 14 | def hello(): 15 | print( 16 | 'Hello world!' 17 | ) 18 | ~~~ 19 | """ 20 | formatted_md = """```python 21 | def hello(): 22 | print("Hello world!") 23 | ``` 24 | """ 25 | assert ( 26 | mdformat.text(unformatted_md, codeformatters={"python"}) 27 | == formatted_md 28 | ) 29 | --------------------------------------------------------------------------------