diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9643905..5daa52d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,6 +61,7 @@ repos: - id: file-contents-sorter files: spelling_private_dict\.txt$ - id: trailing-whitespace + exclude: ^tests/test_doccmd/.*\.txt$ - repo: https://github.com/pre-commit/pygrep-hooks rev: v1.10.0 hooks: diff --git a/src/doccmd/__init__.py b/src/doccmd/__init__.py index 6956bee..f809157 100644 --- a/src/doccmd/__init__.py +++ b/src/doccmd/__init__.py @@ -426,17 +426,17 @@ def _run_args_against_docs( help=( """\ The marker used to identify code blocks to be skipped. - \b + By default, code blocks which come just after a comment matching 'skip doccmd[all]: next' are skipped (e.g. `.. skip doccmd[all]: next` in reStructuredText, `` in Markdown, or `% skip doccmd[all]: next` in MyST). - \b + When using this option, those, and code blocks which come just after a comment including the given marker are ignored. For example, if the given marker is 'type-check', code blocks which come just after a comment matching 'skip doccmd[type-check]: next' are also skipped. - \b + This marker is matched using a regular expression. """ ), diff --git a/tests/test_doccmd/test_help.txt b/tests/test_doccmd/test_help.txt index aff7052..878e629 100644 --- a/tests/test_doccmd/test_help.txt +++ b/tests/test_doccmd/test_help.txt @@ -22,18 +22,22 @@ Options: other files, e.g. for ignoring in linter configurations. [default: doccmd; required] --skip-marker TEXT The marker used to identify code blocks to be - skipped.  By default, code blocks which come - just after a comment matching 'skip - doccmd[all]: next' are skipped (e.g. `.. skip - doccmd[all]: next` in reStructuredText, `` in Markdown, or `% - skip doccmd[all]: next` in MyST).  When using - this option, those, and code blocks which come - just after a comment including the given - marker are ignored. For example, if the given - marker is 'type-check', code blocks which come - just after a comment matching 'skip - doccmd[type-check]: next' are also skipped.  + skipped. + + By default, code blocks which come just after + a comment matching 'skip doccmd[all]: next' + are skipped (e.g. `.. skip doccmd[all]: next` + in reStructuredText, `` in Markdown, or `% skip doccmd[all]: + next` in MyST). + + When using this option, those, and code blocks + which come just after a comment including the + given marker are ignored. For example, if the + given marker is 'type-check', code blocks + which come just after a comment matching 'skip + doccmd[type-check]: next' are also skipped. + This marker is matched using a regular expression. --pad-file / --no-pad-file Run the command against a temporary file