Run pre-commit hook entry. Allow to run pre-commit hooks for text editor formatting / linting needs.
Project description
Run pre-commit hook entry. Allow to run pre-commit hooks for text editor formatting / linting needs.
Requirements
Python 3.7 or later
pre-commit 2.4.0 or later
License
pre-commit-run-hook-entry is licensed under the terms of BSD-3-Clause license.
Installation
pip install pre-commit-run-hook-entry
Usage
pre-commit-run-hook-entry HOOK
Prerequisites
pre-commit-run-hook-entry only works in directories, where pre-commit run --all HOOK is executable.
VS Code Integration
Example below illustrates how to configure VS Code to use black, flake8 & mypy pre-commit hooks for formatting & linting,
{
"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
sublack
From one point 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,
{
"sublack.black_command": "pre-commit-run-black-entry"
}
SublimeLinter-contrib-flake8
{
"SublimeLinter.linters.flake8.executable": "pre-commit-run-hook-entry",
"SublimeLinter.linters.flake8.args": ["--", "flake8"]
}
SublimeLinter-contrib-mypy
{
"SublimeLinter.linters.mypy.executable": "pre-commit-run-hook-entry",
"SublimeLinter.linters.mypy.args": ["--", "mypy"]
}
Issues & Feature Requests
Feel free to submit new issue or feature request at GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pre-commit-run-hook-entry-1.0.0a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b15e2eded48ab7500694b51eff7da108f56621bb2cfdd4eac1366fafdb621db |
|
MD5 | ccda513cbd36dbd910e15d70851c4ca9 |
|
BLAKE2b-256 | 15097f33e8290cb9a2fbfd7732d0f2a41e03c6d43c0ee287d8064a67d4c8b67c |
Hashes for pre_commit_run_hook_entry-1.0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7be1c773b640ab5c97e128301967bb4b13348e2a0484d7c7e9c7142bbce8124 |
|
MD5 | da7c0db4696eaf254d809b2d9cb97d7c |
|
BLAKE2b-256 | 0b8007c2050e0aa7df72f80da4b9aced88d2cf2ccae250ef71fc7cf38e93b1ba |