pre-commit hooks for PO files
Project description
pre-commit-po-hooks
Hooks for pre-commit useful working with PO files.
Example configuration
- repo: https://github.com/mondeja/pre-commit-po-hooks
rev: v1.0.0
hooks:
- id: obsolete-messages
- id: untranslated-messages
- id: lreplace-extracted-comments
args:
- -m
- 'Translators: '
- -r
- ''
- id: check-metadata
args:
- -h
- Project-Id-Version
- -v
- v\d+\.\d+\.\d+
Hooks
obsolete-messages
Checks for obsolete messages printing their line numbers if found.
untranslated-messages
Checks for untranslated messages printing their line numbers if found.
lreplace-extracted-comments
Replaces a matching string at the beginning of the extracted comments. This can be used to remove the string "Translators: " introduced by Django (see more about this problem in django-rosetta#245).
Parameters
-m/--match "STRING"
: Matching string to be replaced.-r/--replacement "STRING"
: Replacement for the match at the beginning of the extracted comment. If you want to remove the matching beginning you can pass an empty string""
.-d/--dry-run
: Don't do the replacements, only writes to stderr the locations of the extracted comments to be replaced.
check-metadata
Check that metadata fields matches a set of regular expressions.
Parameters
-h/--header HEADER
: Header name to match in metadata. This argument can be passed multiple times, but after each-h/--header
argument must be a-v/--value
that indicates the regular expression for that header.-v/--value REGEX
: Can be passed multiple times. Indicates the regular expression that the last header passed in the argument-h/--header
must match in the checked PO files.
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
Close
Hashes for pre_commit_po_hooks-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bccfb6d2c510bf43ee5af7b51965ba8dafaffee0f18b9e889424b9711a2d0b3a |
|
MD5 | 0713dbd9fff1122d2861efac929076d6 |
|
BLAKE2b-256 | 8b2a3762fc14518007df631b3b349cd6378e9b535c0959831a8bb43b3dd5e060 |
Close
Hashes for pre_commit_po_hooks-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1031c9d93a9848711df6621f8fae7069bd1b76de91c6776c2a8ee2d7181aeaf |
|
MD5 | e2882a8d8079b29f539f5647d471bb83 |
|
BLAKE2b-256 | ff27d2e78a65f7cd99916cf6d96fbbe92a11cd2fa1c9682e0e360d8cd21ebd52 |