=========================
pre-commit-run-hook-entry
=========================
.. image:: https://github.com/playpauseandstop/pre-commit-run-hook-entry/actions/workflows/ci.yml/badge.svg
:target: https://github.com/playpauseandstop/pre-commit-run-hook-entry/actions/workflows/ci.yml
:alt: CI
.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black
.. image:: https://img.shields.io/pypi/v/pre-commit-run-hook-entry.svg
:target: https://pypi.org/project/pre-commit-run-hook-entry/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/pyversions/pre-commit-run-hook-entry.svg
:target: https://pypi.org/project/pre-commit-run-hook-entry/
:alt: Python versions
.. image:: https://img.shields.io/pypi/l/pre-commit-run-hook-entry.svg
:target: https://github.com/playpauseandstop/pre-commit-run-hook-entry/blob/main/LICENSE
:alt: BSD License
.. image:: https://coveralls.io/repos/playpauseandstop/pre-commit-run-hook-entry/badge.svg?branch=main&service=github
:target: https://coveralls.io/github/playpauseandstop/pre-commit-run-hook-entry
:alt: Coverage
Run `pre-commit`_ hook entry. Allow to run pre-commit hooks for text editor
formatting / linting needs.
.. _`pre-commit`: https://pre-commit.com/
Danger Zone
===========
**IMPORTANT:** This is highly experimental tool as `pre-commit internals does
not intend to be used in other scripts
<https://github.com/pre-commit/pre-commit/issues/1468#issuecomment-640699437>`_.
It might be broken after new pre-commit release.
**TO USE WITH CAUTION!**
Requirements
============
- `Python <https://www.python.org/>`_ 3.9 or later
- `pre-commit`_ 4.0 or later
License
=======
``pre-commit-run-hook-entry`` is licensed under the terms of
`BSD-3-Clause </LICENSE>`_ license.
Installation
============
.. code-block:: bash
pip install pre-commit-run-hook-entry
Usage
=====
.. code-block:: bash
pre-commit-run-hook-entry HOOK [ARGS]
pre-commit-which-hook-entry HOOK
Prerequisites
-------------
``pre-commit-run-hook-entry`` only works in directories, where
``pre-commit run --all HOOK`` is executable.
pre-commit Versions Support
---------------------------
================================= ===================
pre-commit-run-hook-entry version pre-commit version
================================= ===================
``1.0.0b0`` or lower ``3.8.0`` or lower
``1.0.0rc0`` or higher ``4.0.0`` or higher
================================= ===================
VS Code Integration
-------------------
Example below illustrates how to configure VS Code to use black, flake8 &
mypy pre-commit hooks for formatting & linting,
.. code-block:: json
{
"python.formatting.provider": "black",
"python.formatting.blackPath": "pre-commit-run-hook-entry",
"python.formatting.blackArgs": ["black"],
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "pre-commit-run-hook-entry",
"python.linting.flake8Args": ["flake8"],
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "pre-commit-run-hook-entry",
"python.linting.mypyArgs": ["mypy"]
}
Sublime Text 3 Integration
--------------------------
isorted
~~~~~~~
.. code-block:: json
{
"isorted.isort_command": ["pre-commit-run-hook-entry", "isort"]
}
sublack
~~~~~~~
From one point `sublack <https://github.com/jgirardet/sublack/>`__ has builtin
pre-commit integration, but it seems do not respect settings from
``pyproject.toml``, to fix this use ``pre-commit-run-black-entry`` as
``sublack.black_command``,
.. code-block:: json
{
"sublack.black_command": "pre-commit-run-black-entry"
}
SublimeLinter-flake8
~~~~~~~~~~~~~~~~~~~~
.. code-block:: json
{
"SublimeLinter.linters.flake8.executable": "pre-commit-run-hook-entry",
"SublimeLinter.linters.flake8.args": ["--", "flake8"]
}
SublimeLinter-contrib-mypy
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: json
{
"SublimeLinter.linters.mypy.executable": "pre-commit-run-hook-entry",
"SublimeLinter.linters.mypy.args": ["--", "mypy"]
}
SublimeJsPrettier
~~~~~~~~~~~~~~~~~
First, you need to find out path to prettier hook entry with,
.. code-block:: bash
pre-commit-which-hook-entry prettier
Then, paste command output (``<OUTPUT>``) into plugin config,
.. code-block:: json
{
"js_prettier": {
"prettier_cli_path": "<OUTPUT>"
}
}
SublimeLinter-eslint
~~~~~~~~~~~~~~~~~~~~
First, you need to find out path to eslint hook entry with,
.. code-block:: bash
pre-commit-which-hook-entry eslint
Then, paste command output (``<OUTPUT>``) into plugin config,
.. code-block:: json
{
"SublimeLinter.linters.eslint.executable": "<OUTPUT>",
"SublimeLinter.linters.eslint.env": {
"NODE_PATH": "<OUTPUT>/../../lib/node_modules"
}
}
**IMPORTANT:** If you're using any ``additionalDependencies`` for eslint hook,
you need to configure ``NODE_PATH``, so plugin will be able to find out given
dependencies.
Issues & Feature Requests
=========================
Feel free to submit new issue or feature request `at GitHub
<https://github.com/playpauseandstop/pre-commit-run-hook-entry/issues>`_
Raw data
{
"_id": null,
"home_page": "https://igordavydenko.com/projects/#pre-commit-run-hook-entry",
"name": "pre-commit-run-hook-entry",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "pre-commit, pre-commit hook, vscode, sublime-text3",
"author": "Igor Davydenko",
"author_email": "iam@igordavydenko.com",
"download_url": "https://files.pythonhosted.org/packages/34/f0/0e427b7028624842c8cb86f7dd8345fb23feda8d551a8ce918c7f5633bea/pre_commit_run_hook_entry-1.0.0rc0.tar.gz",
"platform": null,
"description": "=========================\npre-commit-run-hook-entry\n=========================\n\n.. image:: https://github.com/playpauseandstop/pre-commit-run-hook-entry/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/playpauseandstop/pre-commit-run-hook-entry/actions/workflows/ci.yml\n :alt: CI\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n :target: https://github.com/pre-commit/pre-commit\n :alt: pre-commit\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/psf/black\n :alt: black\n\n.. image:: https://img.shields.io/pypi/v/pre-commit-run-hook-entry.svg\n :target: https://pypi.org/project/pre-commit-run-hook-entry/\n :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/pyversions/pre-commit-run-hook-entry.svg\n :target: https://pypi.org/project/pre-commit-run-hook-entry/\n :alt: Python versions\n\n.. image:: https://img.shields.io/pypi/l/pre-commit-run-hook-entry.svg\n :target: https://github.com/playpauseandstop/pre-commit-run-hook-entry/blob/main/LICENSE\n :alt: BSD License\n\n.. image:: https://coveralls.io/repos/playpauseandstop/pre-commit-run-hook-entry/badge.svg?branch=main&service=github\n :target: https://coveralls.io/github/playpauseandstop/pre-commit-run-hook-entry\n :alt: Coverage\n\nRun `pre-commit`_ hook entry. Allow to run pre-commit hooks for text editor\nformatting / linting needs.\n\n.. _`pre-commit`: https://pre-commit.com/\n\nDanger Zone\n===========\n\n**IMPORTANT:** This is highly experimental tool as `pre-commit internals does\nnot intend to be used in other scripts\n<https://github.com/pre-commit/pre-commit/issues/1468#issuecomment-640699437>`_.\nIt might be broken after new pre-commit release.\n\n**TO USE WITH CAUTION!**\n\nRequirements\n============\n\n- `Python <https://www.python.org/>`_ 3.9 or later\n- `pre-commit`_ 4.0 or later\n\nLicense\n=======\n\n``pre-commit-run-hook-entry`` is licensed under the terms of\n`BSD-3-Clause </LICENSE>`_ license.\n\nInstallation\n============\n\n.. code-block:: bash\n\n pip install pre-commit-run-hook-entry\n\nUsage\n=====\n\n.. code-block:: bash\n\n pre-commit-run-hook-entry HOOK [ARGS]\n pre-commit-which-hook-entry HOOK\n\nPrerequisites\n-------------\n\n``pre-commit-run-hook-entry`` only works in directories, where\n``pre-commit run --all HOOK`` is executable.\n\npre-commit Versions Support\n---------------------------\n\n================================= ===================\npre-commit-run-hook-entry version pre-commit version\n================================= ===================\n``1.0.0b0`` or lower ``3.8.0`` or lower\n``1.0.0rc0`` or higher ``4.0.0`` or higher\n================================= ===================\n\nVS Code Integration\n-------------------\n\nExample below illustrates how to configure VS Code to use black, flake8 &\nmypy pre-commit hooks for formatting & linting,\n\n.. code-block:: json\n\n {\n \"python.formatting.provider\": \"black\",\n \"python.formatting.blackPath\": \"pre-commit-run-hook-entry\",\n \"python.formatting.blackArgs\": [\"black\"],\n \"python.linting.enabled\": true,\n \"python.linting.flake8Enabled\": true,\n \"python.linting.flake8Path\": \"pre-commit-run-hook-entry\",\n \"python.linting.flake8Args\": [\"flake8\"],\n \"python.linting.mypyEnabled\": true,\n \"python.linting.mypyPath\": \"pre-commit-run-hook-entry\",\n \"python.linting.mypyArgs\": [\"mypy\"]\n }\n\nSublime Text 3 Integration\n--------------------------\n\nisorted\n~~~~~~~\n\n.. code-block:: json\n\n {\n \"isorted.isort_command\": [\"pre-commit-run-hook-entry\", \"isort\"]\n }\n\nsublack\n~~~~~~~\n\nFrom one point `sublack <https://github.com/jgirardet/sublack/>`__ has builtin\npre-commit integration, but it seems do not respect settings from\n``pyproject.toml``, to fix this use ``pre-commit-run-black-entry`` as\n``sublack.black_command``,\n\n.. code-block:: json\n\n {\n \"sublack.black_command\": \"pre-commit-run-black-entry\"\n }\n\n\nSublimeLinter-flake8\n~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: json\n\n {\n \"SublimeLinter.linters.flake8.executable\": \"pre-commit-run-hook-entry\",\n \"SublimeLinter.linters.flake8.args\": [\"--\", \"flake8\"]\n }\n\n\nSublimeLinter-contrib-mypy\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: json\n\n {\n \"SublimeLinter.linters.mypy.executable\": \"pre-commit-run-hook-entry\",\n \"SublimeLinter.linters.mypy.args\": [\"--\", \"mypy\"]\n }\n\nSublimeJsPrettier\n~~~~~~~~~~~~~~~~~\n\nFirst, you need to find out path to prettier hook entry with,\n\n.. code-block:: bash\n\n pre-commit-which-hook-entry prettier\n\nThen, paste command output (``<OUTPUT>``) into plugin config,\n\n.. code-block:: json\n\n {\n \"js_prettier\": {\n \"prettier_cli_path\": \"<OUTPUT>\"\n }\n }\n\nSublimeLinter-eslint\n~~~~~~~~~~~~~~~~~~~~\n\nFirst, you need to find out path to eslint hook entry with,\n\n.. code-block:: bash\n\n pre-commit-which-hook-entry eslint\n\nThen, paste command output (``<OUTPUT>``) into plugin config,\n\n.. code-block:: json\n\n {\n \"SublimeLinter.linters.eslint.executable\": \"<OUTPUT>\",\n \"SublimeLinter.linters.eslint.env\": {\n \"NODE_PATH\": \"<OUTPUT>/../../lib/node_modules\"\n }\n }\n\n**IMPORTANT:** If you're using any ``additionalDependencies`` for eslint hook,\nyou need to configure ``NODE_PATH``, so plugin will be able to find out given\ndependencies.\n\nIssues & Feature Requests\n=========================\n\nFeel free to submit new issue or feature request `at GitHub\n<https://github.com/playpauseandstop/pre-commit-run-hook-entry/issues>`_\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Run pre-commit hook entry. Allow to run pre-commit hooks for text editor formatting / linting needs",
"version": "1.0.0rc0",
"project_urls": {
"Bug Tracker": "https://github.com/playpauseandstop/pre-commit-run-hook-entry/issues",
"Homepage": "https://igordavydenko.com/projects/#pre-commit-run-hook-entry",
"Repository": "https://github.com/playpauseandstop/pre-commit-run-hook-entry"
},
"split_keywords": [
"pre-commit",
" pre-commit hook",
" vscode",
" sublime-text3"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c1d96a21eed2ff2fb262321fe1f5db27060adda55483f8db307e3e4d2135354f",
"md5": "2137efe22417ca3e21e3a8b8ae638901",
"sha256": "9a7e5e3e89490538e3f17f571492a5282b1db97522d62b63e1bf3ef4fd8a3878"
},
"downloads": -1,
"filename": "pre_commit_run_hook_entry-1.0.0rc0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2137efe22417ca3e21e3a8b8ae638901",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 7801,
"upload_time": "2024-12-27T11:10:13",
"upload_time_iso_8601": "2024-12-27T11:10:13.466928Z",
"url": "https://files.pythonhosted.org/packages/c1/d9/6a21eed2ff2fb262321fe1f5db27060adda55483f8db307e3e4d2135354f/pre_commit_run_hook_entry-1.0.0rc0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "34f00e427b7028624842c8cb86f7dd8345fb23feda8d551a8ce918c7f5633bea",
"md5": "350cf108e8d0498d61b4f84484517442",
"sha256": "e3f9d45cba69698d9ad21f711170d18eee5ab974f8d6d769e9ad77cc658a66f2"
},
"downloads": -1,
"filename": "pre_commit_run_hook_entry-1.0.0rc0.tar.gz",
"has_sig": false,
"md5_digest": "350cf108e8d0498d61b4f84484517442",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 7077,
"upload_time": "2024-12-27T11:10:16",
"upload_time_iso_8601": "2024-12-27T11:10:16.217146Z",
"url": "https://files.pythonhosted.org/packages/34/f0/0e427b7028624842c8cb86f7dd8345fb23feda8d551a8ce918c7f5633bea/pre_commit_run_hook_entry-1.0.0rc0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-27 11:10:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "playpauseandstop",
"github_project": "pre-commit-run-hook-entry",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pre-commit-run-hook-entry"
}