Skip to content

Commit bd44df0

Browse files
authored
feat(all): pre-commit (#173)
1 parent b1e1332 commit bd44df0

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- repo: https://github.com/pre-commit/mirrors-yapf
7+
rev: 'v0.32.0'
8+
hooks:
9+
- id: yapf
10+
- repo: https://github.com/pycqa/flake8
11+
rev: '3.8.2'
12+
hooks:
13+
- id: flake8
14+
- repo: https://github.com/pre-commit/mirrors-clang-format
15+
rev: 'v17.0.6'
16+
hooks:
17+
- id: clang-format
18+
- repo: https://github.com/cpplint/cpplint
19+
rev: '1.6.1'
20+
hooks:
21+
- id: cpplint

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ For users who want modifications and adapt tn/itn rules to fix badcase, please t
5353
``` bash
5454
git clone https://github.com/wenet-e2e/WeTextProcessing.git
5555
cd WeTextProcessing
56+
pip install -r requirements.txt
57+
pre-commit install # for clean and tidy code
5658
# `overwrite_cache` will rebuild all rules according to
5759
# your modifications on tn/chinese/rules/xx.py (itn/chinese/rules/xx.py).
5860
# After rebuild, you can find new far files at `$PWD/tn` and `$PWD/itn`.

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ flake8
22
importlib_resources
33
pynini==2.1.5
44
pytest
5+
pre-commit==3.5.0

0 commit comments

Comments
 (0)