Feat: Remove rst_check
This commit is contained in:
parent
7d91ac3206
commit
27ea017058
@ -1 +1 @@
|
|||||||
__version__ = "0.1.3"
|
__version__ = "0.1.4"
|
||||||
|
@ -126,13 +126,7 @@ NORMALIZERS_NEW = {
|
|||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.argument("commited_files", nargs=-1)
|
@click.argument("commited_files", nargs=-1)
|
||||||
@click.option(
|
def main(commited_files: list) -> int:
|
||||||
"--ignore_directive",
|
|
||||||
multiple=True,
|
|
||||||
default=[],
|
|
||||||
help="List of ignored directives for restructuredtext_lint",
|
|
||||||
)
|
|
||||||
def main(commited_files: list, ignore_directive: list) -> int:
|
|
||||||
|
|
||||||
r = Repo()
|
r = Repo()
|
||||||
diff = get_commited_files(r)
|
diff = get_commited_files(r)
|
||||||
@ -142,11 +136,9 @@ def main(commited_files: list, ignore_directive: list) -> int:
|
|||||||
|
|
||||||
# New files
|
# New files
|
||||||
for f in select_by_extension(diff["A"], "rst"):
|
for f in select_by_extension(diff["A"], "rst"):
|
||||||
errors += rst_lint(f, ignore_directives=ignore_directive)
|
|
||||||
modified += normalize_file(f, NORMALIZERS_NEW)
|
modified += normalize_file(f, NORMALIZERS_NEW)
|
||||||
# Modified files
|
# Modified files
|
||||||
for f in select_by_extension(diff["M"], "rst"):
|
for f in select_by_extension(diff["M"], "rst"):
|
||||||
errors += rst_lint(f, ignore_directives=ignore_directive)
|
|
||||||
modified += normalize_file(f, NORMALIZERS_MODIFIED)
|
modified += normalize_file(f, NORMALIZERS_MODIFIED)
|
||||||
|
|
||||||
return int(len(errors) > 0)
|
return int(len(errors) > 0)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "clean-rst"
|
name = "clean-rst"
|
||||||
version = "0.1.3"
|
version = "0.1.4"
|
||||||
description = "pre-commit to clean rst index files"
|
description = "pre-commit to clean rst index files"
|
||||||
authors = ["Bertrand Benjamin <benjamin.bertrand@opytex.org>"]
|
authors = ["Bertrand Benjamin <benjamin.bertrand@opytex.org>"]
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@ from clean_rst import __version__
|
|||||||
|
|
||||||
|
|
||||||
def test_version():
|
def test_version():
|
||||||
assert __version__ == "0.1.3"
|
assert __version__ == "0.1.4"
|
||||||
|
Loading…
Reference in New Issue
Block a user