From 05c1f8bc58b13b92a95e2b98050b2785ca56bc11 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Fri, 30 Aug 2024 18:02:32 +0800 Subject: [PATCH] disposable: test #115 --- download-more-tests.sh | 26 ++++++++++++++++---------- sphinxlint/checkers.py | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/download-more-tests.sh b/download-more-tests.sh index ade2fd5ca..f8bba4fc6 100644 --- a/download-more-tests.sh +++ b/download-more-tests.sh @@ -22,24 +22,29 @@ # https://github.com/jazzband/django-oauth-toolkit docs # https://github.com/neo4j/neo4j-python-driver docs -# https://github.com/pandas-dev/pandas doc -# https://github.com/python/peps . --disable=trailing-whitespace -# https://github.com/python/cpython Doc --enable default-role -# https://github.com/python/devguide/ . --enable default-role -# https://github.com/spyder-ide/spyder-docs doc --enable all --disable line-too-long -# https://github.com/sympy/sympy doc -# https://github.com/sphinx-doc/sphinx doc --enable line-too-long --max-line-length 85 -# https://github.com/python/python-docs-fr . --enable all --disable line-too-long +# https://github.com/mattwang44/pandas doc fix-unnecessary-parentheses-in-rst-content +# https://github.com/python/peps . '' --disable=trailing-whitespace +# https://github.com/mattwang44/cpython Doc fix-unnecessary-parentheses-in-rst-content --enable default-role +# https://github.com/python/devguide/ . '' --enable default-role +# https://github.com/spyder-ide/spyder-docs doc '' --enable all --disable line-too-long +# https://github.com/mattwang44/sympy doc fix-unnecessary-parentheses-in-rst-content +# https://github.com/mattwang44/sphinx doc fix-unnecessary-parentheses-in-rst-content --enable line-too-long --max-line-length 85 +# https://github.com/python/python-docs-fr . '' --enable all --disable line-too-long grep '^# https://' "$0" | - while read -r _ repo directory flags + while read -r _ repo directory branch flags do name="$(basename "$repo")" target="tests/fixtures/friends/$name" rm -fr "$target" if [ "$directory" = "." ] then - git clone --depth 1 "$repo" "tests/fixtures/friends/$name" + if [ "$branch" = '' ] + then + git clone --depth 1 "$repo" "tests/fixtures/friends/$name" + else + git clone --depth 1 "$repo" "tests/fixtures/friends/$name" -b "$branch" + fi else git clone --depth 1 --sparse --filter=blob:none "$repo" "tests/fixtures/friends/$name" && ( @@ -50,6 +55,7 @@ grep '^# https://' "$0" | ) fi printf "%s\n" "$flags" > "tests/fixtures/friends/$name/flags" + print "-" done # Remove exceptions: diff --git a/sphinxlint/checkers.py b/sphinxlint/checkers.py index ccdfaa2a7..6c159080d 100644 --- a/sphinxlint/checkers.py +++ b/sphinxlint/checkers.py @@ -515,7 +515,7 @@ def check_dangling_hyphen(file, lines, options): yield lno + 1, "Line ends with dangling hyphen" -@checker(".rst", ".po", rst_only=False, enabled=False) +@checker(".rst", ".po", rst_only=False, enabled=True) def check_unnecessary_func_parentheses(filename, lines, options): """Check for unnecessary parentheses in :func: roles.