diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08185da6..8e4d289d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: args: [--prose-wrap=preserve] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "89c421dff2e1026ba12cdb9ebd731f4a83aa8021" # frozen: v0.8.6 + rev: "971923581912ef60a6b70dbf0c3e9a39563c9d47" # frozen: v0.11.4 hooks: - id: ruff args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"] diff --git a/numpydoc/cli.py b/numpydoc/cli.py index ef8cff2c..53335fdf 100644 --- a/numpydoc/cli.py +++ b/numpydoc/cli.py @@ -104,10 +104,11 @@ def _parse_config(s): nargs="*", help=( f"""Check codes to ignore.{ - ' Currently ignoring the following from ' - f'{Path(project_root_from_cwd) / config_file}: {ignored_checks_text}' - 'Values provided here will be in addition to the above, unless an alternate config is provided.' - if ignored_checks else '' + " Currently ignoring the following from " + f"{Path(project_root_from_cwd) / config_file}: {ignored_checks_text}" + "Values provided here will be in addition to the above, unless an alternate config is provided." + if ignored_checks + else "" }""" ), ) diff --git a/numpydoc/docscrape.py b/numpydoc/docscrape.py index bfc2840e..54863d5f 100644 --- a/numpydoc/docscrape.py +++ b/numpydoc/docscrape.py @@ -232,8 +232,7 @@ def _parse_param_list(self, content, single_element_is_type=False): # NOTE: param line with single element should never have a # a " :" before the description line, so this should probably # warn. - if header.endswith(" :"): - header = header[:-2] + header = header.removesuffix(" :") if single_element_is_type: arg_name, arg_type = "", header else: diff --git a/numpydoc/validate.py b/numpydoc/validate.py index 858a06d2..db605949 100644 --- a/numpydoc/validate.py +++ b/numpydoc/validate.py @@ -80,8 +80,7 @@ "PR06": 'Parameter "{param_name}" type should use "{right_type}" instead ' 'of "{wrong_type}"', "PR07": 'Parameter "{param_name}" has no description', - "PR08": 'Parameter "{param_name}" description should start with a ' - "capital letter", + "PR08": 'Parameter "{param_name}" description should start with a capital letter', "PR09": 'Parameter "{param_name}" description should finish with "."', "PR10": 'Parameter "{param_name}" requires a space before the colon ' "separating the parameter name and type",