File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11# typos-pre-commit-mirror
22
3- Support ` pre-commit <= 3.2.0 ` .< br >
3+ Mirror of the ` typos ` pre-commit hook for ` pre-commit ` . Supports ` pre-commit ` versions 2.9.2 and later.
44
5- For example ` pre-commit ` configs, please see the [ pre-commit.md ] ( https://github.com/crate-ci/typos/blob/master/docs/pre-commit.md )
5+ ## Usage
66
7+ Add this to your ` .pre-commit-config.yaml ` :
8+
9+ ``` yaml
10+ - repo : https://github.com/PFCCLab/typos-pre-commit-mirror.git
11+ rev : v1.29.4
12+ hooks :
13+ - id : typos
14+ args : [--force-exclude]
15+ ` ` `
Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ def main():
2222 # Load pyproject.toml
2323 with open (Path (__file__ ).parent / "pyproject.toml" , "rb" ) as f :
2424 pyproject = tomli .load (f )
25+ # Load README.md
26+ with open (Path (__file__ ).parent / "README.md" , "r" ) as f :
27+ readme = f .read ()
2528
2629 # θ·εε½εηζ¬η typos
2730 deps = pyproject ["project" ]["dependencies" ]
@@ -48,8 +51,14 @@ def main():
4851 # Update pyproject.toml
4952 pyproject ["project" ]["version" ] = str (version )
5053 pyproject ["project" ]["dependencies" ] = [f"typos=={ version } " ]
54+ # Update README.md
55+ readme = readme .replace (str (current_version ), str (version ))
56+
57+ # Write pyproject.toml and README.md
5158 with open (Path (__file__ ).parent / "pyproject.toml" , "wb" ) as f :
5259 tomli_w .dump (pyproject , f )
60+ with open (Path (__file__ ).parent / "README.md" , "w" ) as f :
61+ f .write (readme )
5362
5463 # Commit and tag
5564 subprocess .run (["git" , "add" , "pyproject.toml" ])
You canβt perform that action at this time.
0 commit comments