django-pre-commit-hooks 0.1.0__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.
- django_pre_commit_hooks/__init__.py +1 -0
- django_pre_commit_hooks/compile_messages.py +37 -0
- django_pre_commit_hooks/py.typed +0 -0
- django_pre_commit_hooks-0.1.0.dist-info/METADATA +108 -0
- django_pre_commit_hooks-0.1.0.dist-info/RECORD +9 -0
- django_pre_commit_hooks-0.1.0.dist-info/WHEEL +5 -0
- django_pre_commit_hooks-0.1.0.dist-info/entry_points.txt +2 -0
- django_pre_commit_hooks-0.1.0.dist-info/licenses/LICENSE +22 -0
- django_pre_commit_hooks-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from collections.abc import Sequence
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from django.core.management import execute_from_command_line
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
11
|
+
"""Run django-admin compilemessages for each .po file."""
|
|
12
|
+
parser = argparse.ArgumentParser()
|
|
13
|
+
parser.add_argument("filenames", nargs="*")
|
|
14
|
+
args = parser.parse_args(argv)
|
|
15
|
+
|
|
16
|
+
retval = 0
|
|
17
|
+
for filename in args.filenames:
|
|
18
|
+
path = Path(filename)
|
|
19
|
+
# Assume the path is <locale>/LC_MESSAGES/django.po
|
|
20
|
+
locale = path.parent.parent
|
|
21
|
+
execute_from_command_line(
|
|
22
|
+
[
|
|
23
|
+
"django-admin",
|
|
24
|
+
"compilemessages",
|
|
25
|
+
"--locale",
|
|
26
|
+
locale.name,
|
|
27
|
+
"--ignore",
|
|
28
|
+
".venv",
|
|
29
|
+
"--ignore",
|
|
30
|
+
".tox",
|
|
31
|
+
]
|
|
32
|
+
)
|
|
33
|
+
return retval
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
raise SystemExit(main())
|
|
File without changes
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-pre-commit-hooks
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A collection of pre-commit hooks for Django projects
|
|
5
|
+
Author-email: Bruno Alla <oss@browniebroke.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/browniebroke/django-pre-commit-hooks/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/browniebroke/django-pre-commit-hooks/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: repository, https://github.com/browniebroke/django-pre-commit-hooks
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: django
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# Django pre-commit hooks
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<a href="https://github.com/browniebroke/django-pre-commit-hooks/actions/workflows/ci.yml?query=branch%3Amain">
|
|
30
|
+
<img src="https://img.shields.io/github/actions/workflow/status/browniebroke/django-pre-commit-hooks/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
31
|
+
</a>
|
|
32
|
+
<a href="https://codecov.io/gh/browniebroke/django-pre-commit-hooks">
|
|
33
|
+
<img src="https://img.shields.io/codecov/c/github/browniebroke/django-pre-commit-hooks.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
34
|
+
</a>
|
|
35
|
+
</p>
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="https://github.com/astral-sh/uv">
|
|
38
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
|
|
39
|
+
</a>
|
|
40
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
41
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
|
|
42
|
+
</a>
|
|
43
|
+
<a href="https://github.com/pre-commit/pre-commit">
|
|
44
|
+
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
|
|
45
|
+
</a>
|
|
46
|
+
</p>
|
|
47
|
+
<p align="center">
|
|
48
|
+
<a href="https://pypi.org/project/django-pre-commit-hooks/">
|
|
49
|
+
<img src="https://img.shields.io/pypi/v/django-pre-commit-hooks.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
50
|
+
</a>
|
|
51
|
+
<img src="https://img.shields.io/pypi/pyversions/django-pre-commit-hooks.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
52
|
+
<img src="https://img.shields.io/pypi/l/django-pre-commit-hooks.svg?style=flat-square" alt="License">
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
**Source Code**: <a href="https://github.com/browniebroke/django-pre-commit-hooks" target="_blank">https://github.com/browniebroke/django-pre-commit-hooks </a>
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
A collection of pre-commit hooks for Django projects
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
Install this via pip (or your favourite package manager):
|
|
66
|
+
|
|
67
|
+
`pip install django-pre-commit-hooks`
|
|
68
|
+
|
|
69
|
+
## Usage
|
|
70
|
+
|
|
71
|
+
Call the command line interface:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
django-pre-commit-hooks --help
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Contributors ✨
|
|
78
|
+
|
|
79
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
80
|
+
|
|
81
|
+
<!-- prettier-ignore-start -->
|
|
82
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
83
|
+
<!-- prettier-ignore-start -->
|
|
84
|
+
<!-- markdownlint-disable -->
|
|
85
|
+
<table>
|
|
86
|
+
<tbody>
|
|
87
|
+
<tr>
|
|
88
|
+
<td align="center" valign="top" width="14.28%"><a href="https://browniebroke.com/"><img src="https://avatars.githubusercontent.com/u/861044?v=4?s=80" width="80px;" alt="Bruno Alla"/><br /><sub><b>Bruno Alla</b></sub></a><br /><a href="https://github.com/browniebroke/django-pre-commit-hooks/commits?author=browniebroke" title="Code">💻</a> <a href="#ideas-browniebroke" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/browniebroke/django-pre-commit-hooks/commits?author=browniebroke" title="Documentation">📖</a></td>
|
|
89
|
+
</tr>
|
|
90
|
+
</tbody>
|
|
91
|
+
</table>
|
|
92
|
+
|
|
93
|
+
<!-- markdownlint-restore -->
|
|
94
|
+
<!-- prettier-ignore-end -->
|
|
95
|
+
|
|
96
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
97
|
+
<!-- prettier-ignore-end -->
|
|
98
|
+
|
|
99
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
100
|
+
|
|
101
|
+
## Credits
|
|
102
|
+
|
|
103
|
+
[](https://github.com/copier-org/copier)
|
|
104
|
+
|
|
105
|
+
This package was created with
|
|
106
|
+
[Copier](https://copier.readthedocs.io/) and the
|
|
107
|
+
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
|
|
108
|
+
project template.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
django_pre_commit_hooks/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
|
+
django_pre_commit_hooks/compile_messages.py,sha256=TP9tqXdyoqH8h0zWtz74Dm6J_zp0DRioonEdJ0yIXb0,970
|
|
3
|
+
django_pre_commit_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
django_pre_commit_hooks-0.1.0.dist-info/licenses/LICENSE,sha256=4YvtWG-4CYmwaaBxd0LC5vA78prQ32qBVoAbN6xrCKI,1068
|
|
5
|
+
django_pre_commit_hooks-0.1.0.dist-info/METADATA,sha256=zu-D2md0rlg0NhhkDXQ3mCKUcbho5ruO3jLUtn6RcOQ,4790
|
|
6
|
+
django_pre_commit_hooks-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
django_pre_commit_hooks-0.1.0.dist-info/entry_points.txt,sha256=WRmPdVwcAq1aYLq2XPrdqOrGigXDLPS6qk6MpgAbioE,83
|
|
8
|
+
django_pre_commit_hooks-0.1.0.dist-info/top_level.txt,sha256=ohzjwjIeu3Iqh06jW5GBQsdQAiBhPLvIubWaUJEcOhY,24
|
|
9
|
+
django_pre_commit_hooks-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Bruno Alla
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
django_pre_commit_hooks
|