lefthook 0.1.1__py3-none-any.whl → 1.7.18__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of lefthook might be problematic. Click here for more details.

lefthook/__init__.py CHANGED
@@ -1,8 +0,0 @@
1
- """Lefthook installer
2
- """
3
-
4
- from ._core import run
5
-
6
-
7
- __version__ = '0.1.1'
8
- __all__ = ['run']
lefthook/__main__.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import sys
2
- from ._core import run
3
2
 
3
+ from .main import main
4
4
 
5
- sys.exit(run())
5
+ if __name__ == "__main__":
6
+ sys.exit(main())
lefthook/main.py ADDED
@@ -0,0 +1,24 @@
1
+ import os
2
+ import sys
3
+ import platform
4
+ import subprocess
5
+
6
+ ISSUE_URL = "https://github.com/evilmartians/lefthook/issues/new/choose"
7
+ ARCH_MAPPING = {
8
+ 'amd64': 'x86_64',
9
+ 'aarch64': 'arm64',
10
+ }
11
+
12
+ def main():
13
+ os_name = platform.system().lower()
14
+ arch = platform.machine().lower()
15
+ arch = ARCH_MAPPING.get(arch, arch)
16
+ ext = os_name == "windows" and ".exe" or ""
17
+ subfolder = f"lefthook-{os_name}-{arch}"
18
+ executable = os.path.join(os.path.dirname(__file__), "bin", subfolder, "lefthook"+ext)
19
+ if not os.path.isfile(executable):
20
+ print(f"Couldn't find binary {executable}. Please create an issue: {ISSUE_URL}")
21
+ return 1
22
+
23
+ result = subprocess.run([executable] + sys.argv[1:])
24
+ return result.returncode
@@ -1,4 +1,7 @@
1
- MIT License 2019 Gram (@orsinium) <master_fess@mail.ru>
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2019 Arkweid
2
5
 
3
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
7
  of this software and associated documentation files (the "Software"), to deal
@@ -7,14 +10,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
10
  copies of the Software, and to permit persons to whom the Software is
8
11
  furnished to do so, subject to the following conditions:
9
12
 
10
- The above copyright notice and this permission notice (including the next
11
- paragraph) shall be included in all copies or substantial portions of the
12
- Software.
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
13
15
 
14
16
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
17
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
18
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
19
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
20
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
- SOFTWARE.
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.1
2
+ Name: lefthook
3
+ Version: 1.7.18
4
+ Summary: Git hooks manager. Fast, powerful, simple.
5
+ Home-page: https://github.com/evilmartians/lefthook
6
+ Author: Evil Martians
7
+ Author-email: lefthook@evilmartians.com
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Topic :: Software Development :: Version Control :: Git
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+
15
+ ![Build Status](https://github.com/evilmartians/lefthook/actions/workflows/test.yml/badge.svg?branch=master)
16
+ [![Coverage Status](https://coveralls.io/repos/github/evilmartians/lefthook/badge.svg?branch=master)](https://coveralls.io/github/evilmartians/lefthook?branch=master)
17
+
18
+ # Lefthook
19
+
20
+ > The fastest polyglot Git hooks manager out there
21
+
22
+ <img align="right" width="147" height="100" title="Lefthook logo"
23
+ src="https://raw.githubusercontent.com/evilmartians/lefthook/refs/heads/master/logo_sign.svg">
24
+
25
+ A Git hooks manager for Node.js, Ruby and many other types of projects.
26
+
27
+ * **Fast.** It is written in Go. Can run commands in parallel.
28
+ * **Powerful.** It allows to control execution and files you pass to your commands.
29
+ * **Simple.** It is single dependency-free binary which can work in any environment.
30
+
31
+ 📖 [Read the introduction post](https://evilmartians.com/chronicles/lefthook-knock-your-teams-code-back-into-shape?utm_source=lefthook)
32
+
33
+ <a href="https://evilmartians.com/?utm_source=lefthook">
34
+ <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"></a>
35
+
36
+ ## Install
37
+
38
+ ```bash
39
+ pip install lefthook
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ Configure your hooks, install them once and forget about it: rely on the magic underneath.
45
+
46
+ #### TL;DR
47
+
48
+ ```bash
49
+ # Configure your hooks
50
+ vim lefthook.yml
51
+
52
+ # Install them to the git project
53
+ lefthook install
54
+
55
+ # Enjoy your work with git
56
+ git add -A && git commit -m '...'
57
+ ```
58
+
59
+ #### More details
60
+
61
+ - [**Configuration**](https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md) for `lefthook.yml` config options.
62
+ - [**Usage**](https://github.com/evilmartians/lefthook/blob/master/docs/usage.md) for **lefthook** CLI options, supported ENVs, and usage tips.
63
+ - [**Discussions**](https://github.com/evilmartians/lefthook/discussions) for questions, ideas, suggestions.
64
+ <!-- - [**Wiki**](https://github.com/evilmartians/lefthook/wiki) for guides, examples, and benchmarks. -->
@@ -0,0 +1,19 @@
1
+ lefthook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ lefthook/__main__.py,sha256=cwKJAAML0RRKT9Qbzcwf07HHcuSd8oh7kx4P1apndWQ,84
3
+ lefthook/main.py,sha256=utJZvXlpb5tyTdEwq6ARkPm7U7CsK1FLKkKIKELnYjQ,742
4
+ lefthook/bin/lefthook-darwin-arm64/lefthook,sha256=AfGxS1yuEnGXYLPXxmrdRJXtIaTQ7ZGiOewARUNs988,7693714
5
+ lefthook/bin/lefthook-darwin-x86_64/lefthook,sha256=7dDTXRLuTXbGilwhZvU_aL2rxQqON4anxRpv_CjJQZw,7974064
6
+ lefthook/bin/lefthook-freebsd-arm64/lefthook,sha256=On7cX4NzdKNuumFvgdagXdRbM4SGCogTa8ncBK0BKJo,7536802
7
+ lefthook/bin/lefthook-freebsd-x86_64/lefthook,sha256=lWhqYCYPmuYTpYkt2kg3G79mmYtQDVMLXAPaWZIUo_M,7786658
8
+ lefthook/bin/lefthook-linux-arm64/lefthook,sha256=fChnc7wbK74Iy2bjeYss_nLPxSdLiVowPSpDDncHUSo,7536792
9
+ lefthook/bin/lefthook-linux-x86_64/lefthook,sha256=eoWOsg4PcRvimQ_FiJDFOgojo3mbQUqi7t5Rd78aluw,7790744
10
+ lefthook/bin/lefthook-openbsd-arm64/lefthook,sha256=mmyaezbSD5m2dbNIx-H5lF4Ar8DM8OiCaDyL2UaFwiM,7536920
11
+ lefthook/bin/lefthook-openbsd-x86_64/lefthook,sha256=Ez0gm-pxiLpzrWtBuCeEL8UgjKYwgeRaC87Fi13gW4I,7815448
12
+ lefthook/bin/lefthook-windows-arm64/lefthook.exe,sha256=9MX-pd9Vn77loa2ogBZ8fxbdpe_2rw1KnTsvgbChhpk,7714304
13
+ lefthook/bin/lefthook-windows-x86_64/lefthook.exe,sha256=s94mrgj_6cpn-6iTceakcnkz2-HOK6MGJSuA9T09lls,8151552
14
+ lefthook-1.7.18.dist-info/LICENSE,sha256=utoBTRclXgrct38PP9xllJ_JYj4zSZmtHa1MEC4Mv0M,1075
15
+ lefthook-1.7.18.dist-info/METADATA,sha256=Ogg9YKifd7TIXzHrrdPwaQ19gqipf9m9YQ5OeR6IypY,2457
16
+ lefthook-1.7.18.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
17
+ lefthook-1.7.18.dist-info/entry_points.txt,sha256=04_Y-yUJ6M5UuWClfzN61AHwCtP99ickKTRLVgkTyOM,48
18
+ lefthook-1.7.18.dist-info/top_level.txt,sha256=6wW3EhxJkO0G-x_aJqSFmgRXp72Pkhy8Az6vxiOhtBA,9
19
+ lefthook-1.7.18.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: dephell (0.1.0)
2
+ Generator: bdist_wheel (0.44.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ lefthook = lefthook.main:main
@@ -0,0 +1 @@
1
+ lefthook
lefthook/_core.py DELETED
@@ -1,44 +0,0 @@
1
- import subprocess
2
- import sys
3
- from shutil import which
4
-
5
-
6
- COMMANDS = (
7
- 'go get github.com/Arkweid/lefthook',
8
- 'brew install Arkweid/lefthook/lefthook',
9
- 'npm install @arkweid/lefthook --save-dev',
10
- 'gem install lefthook',
11
- )
12
-
13
-
14
- def _install(command: str) -> bool:
15
- executable = command.split(' ', maxsplit=1)[0]
16
- if not which(executable):
17
- print('#', executable, 'not found')
18
- return False
19
- result = subprocess.run(command.split())
20
- if result.returncode != 0:
21
- return False
22
- print('# installed with', executable)
23
- return True
24
-
25
-
26
- def install() -> bool:
27
- for command in COMMANDS:
28
- if _install(command):
29
- return True
30
- return False
31
-
32
-
33
- def run(argv: list = None) -> int:
34
- if argv is None:
35
- argv = sys.argv
36
-
37
- if not which('lefthook'):
38
- print('# lefthook not found, trying to install')
39
- if not install():
40
- print('! cannot install lefthook')
41
- return 1
42
-
43
- result = subprocess.run(['lefthook'] + argv[1:])
44
- return result.returncode
@@ -1,37 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: lefthook
3
- Version: 0.1.1
4
- Summary: Lefthook installer
5
- Home-Page: https://gitlab.com/life4/lefthook
6
- Project-URL: Lefthook, https://github.com/Arkweid/lefthook
7
- Author: Gram (@orsinium)
8
- Author-email: master_fess@mail.ru
9
- Requires-Python: >=3.5
10
-
11
-
12
- Lefthook
13
- ========
14
-
15
- Wrapper for `lefthook <https://github.com/Arkweid/lefthook>`_ to make it installable in the Python ecosystem. Add it into your project dependencies if you want to use lefthook in your Python project.
16
-
17
- Installation
18
- ------------
19
-
20
- .. code-block:: bash
21
-
22
- python3 -m pip install --user lefthook
23
-
24
- Usage
25
- -----
26
-
27
- You can use this module as proxy for original lefthook. It can be installed on the first execution.
28
-
29
- .. code-block:: bash
30
-
31
- python3 -m lefthook --help
32
-
33
- This command will install the latest lefthook release and call ``lefthook --help``. Now, you can use lefthook directly:
34
-
35
- .. code-block:: bash
36
-
37
- lefthook --help
@@ -1,10 +0,0 @@
1
- lefthook-0.1.1.dist-info/dependency_links.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- lefthook-0.1.1.dist-info/entry_points.txt,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- lefthook-0.1.1.dist-info/METADATA,sha256=ap8ZHabB309g5RLBCTfEdcbLXuFoAVr2IhcprS23pBQ,909
4
- lefthook-0.1.1.dist-info/top_level.txt,sha256=RzPHPkff2O9XK4zLWjC2ExlzIVljsu3gFrzJBMICyzU,8
5
- lefthook-0.1.1.dist-info/WHEEL,sha256=Us79eivRQjLGHRjcJWcKLoOci69wgGrVnpmn7W4m6PA,86
6
- lefthook/__main__.py,sha256=-7JJFUHmxEKclajPrFyJhZsua5wsIxeg3g-QU-LkZtU,52
7
- lefthook/__init__.py,sha256=I3gj3LBil-FXXcWkATDMcBynTMABk0rZxJgZxCc6qcQ,92
8
- lefthook/_core.py,sha256=FETf5tCQ4lUnXWrhU3xptNYH14Eh64Qe1q8Poq7sWIg,1046
9
- lefthook-0.1.1.dist-info/LICENSE,sha256=PFoNi_2luZiYssNqXwE1J7gsoFPcLyxVSP-m_u_LLMU,1111
10
- lefthook-0.1.1.dist-info/RECORD,,
File without changes
File without changes
@@ -1 +0,0 @@
1
- lefthook