From 284b63ae63e39cd8f5ac0b9133bc7853d3baa59a Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 21 Feb 2025 09:39:43 +0000 Subject: [PATCH 01/10] Bumped requirements files --- docs/requirements.txt | 12 +++++++----- requirements-tests.txt | 14 +++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 2a8de6a..47d9fe7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ alabaster==1.0.0 -babel==2.16.0 -beautifulsoup4==4.12.3 -certifi==2024.12.14 +babel==2.17.0 +beautifulsoup4==4.13.3 +certifi==2025.1.31 charset-normalizer==3.4.1 docutils==0.21.2 furo==2024.8.6 @@ -12,10 +12,11 @@ MarkupSafe==3.0.2 packaging==24.2 Pygments==2.19.1 requests==2.32.3 +roman-numerals-py==3.0.0 snowballstemmer==2.2.0 soupsieve==2.6 -Sphinx==8.1.3 -sphinx-autodoc-typehints==3.0.0 +Sphinx==8.2.0 +sphinx-autodoc-typehints==3.1.0 sphinx-basic-ng==1.0.0b2 sphinxcontrib-applehelp==2.0.0 sphinxcontrib-devhelp==2.0.0 @@ -23,4 +24,5 @@ sphinxcontrib-htmlhelp==2.1.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 +typing_extensions==4.12.2 urllib3==2.3.0 diff --git a/requirements-tests.txt b/requirements-tests.txt index 24601ce..e75e0d1 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,9 +1,9 @@ -boto3==1.35.93 -botocore==1.35.93 -certifi==2024.12.14 +boto3==1.36.25 +botocore==1.36.25 +certifi==2025.1.31 cffi==1.17.1 charset-normalizer==3.4.1 -cryptography==44.0.0 +cryptography==44.0.1 idna==3.10 Jinja2==3.1.5 jmespath==1.0.1 @@ -13,9 +13,9 @@ pycparser==2.22 python-dateutil==2.9.0.post0 PyYAML==6.0.2 requests==2.32.3 -responses==0.25.3 -s3transfer==0.10.4 +responses==0.25.6 +s3transfer==0.11.2 six==1.17.0 -urllib3==1.26.20 +urllib3==2.3.0 Werkzeug==3.1.3 xmltodict==0.14.2 From 9ccea4a08e000bbdd252f604a948db1349337939 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:13:03 +0000 Subject: [PATCH 02/10] Bumped pre-commit hook version numbers --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3520bc..744601f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-added-large-files args: [--enforce-all, --maxkb=100] - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 6.0.0 hooks: - id: isort - repo: https://github.com/jumanjihouse/pre-commit-hooks @@ -24,12 +24,12 @@ repos: - id: forbid-crlf - id: forbid-tabs - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.17.0 + rev: v8.17.2 hooks: - id: cspell exclude: \.gitignore|.*\.properties - repo: https://github.com/pycqa/flake8 - rev: 7.1.1 + rev: 7.1.2 hooks: - id: flake8 args: [--max-line-length=150] @@ -41,12 +41,12 @@ repos: additional_dependencies: ["tomli"] exclude: examples|tests|conf.py - repo: https://github.com/regebro/pyroma - rev: f4ef6995f6c054586fe6d5d33d180abe71ebabd0 + rev: "4.2" hooks: - id: pyroma - args: ["-d", "--min=10", ".", "--skip-tests", "ValidREST"] + args: ["-d", "--min=10", "."] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.14.1 + rev: v1.15.0 hooks: - id: mypy additional_dependencies: ["types-docutils", "types-python-dateutil", "types-requests"] From 7054ff3b72f899dd4f4b3b40aeca4a415c4a8a92 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:15:42 +0000 Subject: [PATCH 03/10] Added yamlfmt pre-commit hook --- .github/workflows/documentation.yaml | 3 --- .github/workflows/pre-commit.yaml | 3 --- .github/workflows/unit-tests.yaml | 3 --- .pre-commit-config.yaml | 8 ++++++-- .readthedocs.yaml | 7 +------ 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index b6ca85b..12787e3 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -1,15 +1,12 @@ name: Build Documentation - on: pull_request: branches: [main] - jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false - steps: - uses: actions/checkout@v3 - name: Set up Python 3.12 diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 5befc4a..9cc8e83 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -1,15 +1,12 @@ name: Run Pre-commit - on: pull_request: branches: [main] - jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false - steps: - uses: actions/checkout@v3 - name: Set up Python 3.12 diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 9172014..0623ed5 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -1,9 +1,7 @@ name: Unit Tests - on: pull_request: branches: [main] - jobs: build: runs-on: ubuntu-latest @@ -11,7 +9,6 @@ jobs: fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 744601f..59b6859 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,10 @@ repos: - id: check-yaml - id: check-added-large-files args: [--enforce-all, --maxkb=100] + - repo: https://github.com/google/yamlfmt + rev: v0.16.0 + hooks: + - id: yamlfmt - repo: https://github.com/pycqa/isort rev: 6.0.0 hooks: @@ -43,8 +47,8 @@ repos: - repo: https://github.com/regebro/pyroma rev: "4.2" hooks: - - id: pyroma - args: ["-d", "--min=10", "."] + - id: pyroma + args: ["-d", "--min=10", "."] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.15.0 hooks: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index cea6e26..5227913 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,19 +1,14 @@ - # Read the Docs configuration file for Sphinx projects # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - version: 2 - build: os: ubuntu-22.04 tools: python: "3.12" - sphinx: configuration: docs/source/conf.py builder: "html" fail_on_warning: true - python: - install: + install: - requirements: docs/requirements.txt From caecb717e4301be85060427ca282d89a72bedf13 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:26:57 +0000 Subject: [PATCH 04/10] Added local string-fixer pre-commit hook --- .pre-commit-config.yaml | 10 +- .pre-commit-hooks/double_string_fixer.py | 117 +++++++++++++++++++++++ cspell.config.yaml | 3 +- 3 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-hooks/double_string_fixer.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59b6859..8c1a6dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,7 +43,7 @@ repos: hooks: - id: pydocstyle additional_dependencies: ["tomli"] - exclude: examples|tests|conf.py + exclude: examples|tests|.pre-commit-hooks|conf.py - repo: https://github.com/regebro/pyroma rev: "4.2" hooks: @@ -63,3 +63,11 @@ repos: - --template - (C) Crown Copyright [OWNER] - --owner=GCHQ + - repo: local + hooks: + - id: double-string-fixer + name: string fixer + description: Replace single-quoted strings with double-quoted strings + types: [python] + language: python + entry: python3 .pre-commit-hooks/double_string_fixer.py diff --git a/.pre-commit-hooks/double_string_fixer.py b/.pre-commit-hooks/double_string_fixer.py new file mode 100644 index 0000000..9a6400e --- /dev/null +++ b/.pre-commit-hooks/double_string_fixer.py @@ -0,0 +1,117 @@ +""" +A copy of https://github.com/pre-commit/pre-commit-hooks/tree/main#double-quote-string-fixer, +except it replaces single-quoted strings with double-quoted strings. + +Copyright (c) 2014 pre-commit dev team: Anthony Sottile, Ken Struys + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +""" +from __future__ import annotations + +import argparse +import io +import re +import sys +import tokenize +from typing import Sequence + +if sys.version_info >= (3, 12): # pragma: >=3.12 cover + FSTRING_START = tokenize.FSTRING_START + FSTRING_END = tokenize.FSTRING_END +else: # pragma: <3.12 cover + FSTRING_START = FSTRING_END = -1 + +START_QUOTE_RE = re.compile("^[a-zA-Z]*'") + + +def handle_match(token_text: str) -> str: + if '"""' in token_text or "'''" in token_text: + return token_text + + match = START_QUOTE_RE.match(token_text) + if match is not None: + meat = token_text[match.end():-1] + if '"' in meat or "'" in meat: + return token_text + else: + return match.group().replace("'", '"') + meat + '"' + else: + return token_text + + +def get_line_offsets_by_line_no(src: str) -> list[int]: + # Padded so we can index with line number + offsets = [-1, 0] + for line in src.splitlines(True): + offsets.append(offsets[-1] + len(line)) + return offsets + + +def fix_strings(filename: str) -> int: + with open(filename, encoding="UTF-8", newline="") as f: + contents = f.read() + line_offsets = get_line_offsets_by_line_no(contents) + + # Basically a mutable string + splitcontents = list(contents) + + fstring_depth = 0 + + # Iterate in reverse so the offsets are always correct + tokens_l = list(tokenize.generate_tokens(io.StringIO(contents).readline)) + tokens = reversed(tokens_l) + for token_type, token_text, (srow, scol), (erow, ecol), _ in tokens: + if token_type == FSTRING_START: # pragma: >=3.12 cover + fstring_depth += 1 + elif token_type == FSTRING_END: # pragma: >=3.12 cover + fstring_depth -= 1 + elif fstring_depth == 0 and token_type == tokenize.STRING: + new_text = handle_match(token_text) + splitcontents[ + line_offsets[srow] + scol: + line_offsets[erow] + ecol + ] = new_text + + new_contents = "".join(splitcontents) + if contents != new_contents: + with open(filename, "w", encoding="UTF-8", newline="") as f: + f.write(new_contents) + return 1 + else: + return 0 + + +def main(argv: Sequence[str] | None = None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument("filenames", nargs="*", help="Filenames to fix") + args = parser.parse_args(argv) + + retv = 0 + + for filename in args.filenames: + return_value = fix_strings(filename) + if return_value != 0: + print(f"Fixing strings in {filename}") + retv |= return_value + + return retv + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/cspell.config.yaml b/cspell.config.yaml index 3b5ba44..49600f7 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -1,10 +1,11 @@ version: "0.2" language: en-GB -useGitignore: true, +useGitignore: true ignorePaths: - tests - requirements*.txt - .pre-commit-config.yaml + - .pre-commit-hooks/* dictionaries: - python words: From 6cb975fd6b304c645c2234b099a040c145a39dd9 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 10:39:07 +0100 Subject: [PATCH 05/10] Added autopep8 pre-commit hook --- .pre-commit-config.yaml | 5 +++++ concoursetools/cli/docstring.py | 2 +- concoursetools/mocking.py | 2 +- pyproject.toml | 8 ++++++++ tests/test_resource.py | 6 +++--- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c1a6dd..1fb7bdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,11 @@ repos: rev: v0.16.0 hooks: - id: yamlfmt + - repo: https://github.com/hhatto/autopep8 + rev: v2.3.2 + hooks: + - id: autopep8 + exclude: docs/source/conf.py - repo: https://github.com/pycqa/isort rev: 6.0.0 hooks: diff --git a/concoursetools/cli/docstring.py b/concoursetools/cli/docstring.py index 986cd07..6ac5056 100644 --- a/concoursetools/cli/docstring.py +++ b/concoursetools/cli/docstring.py @@ -76,6 +76,6 @@ def _pair_up(data: list[str]) -> Generator[tuple[str, str], None, None]: """ for i in range(0, len(data), 2): try: - yield data[i], data[i+1] + yield data[i], data[i + 1] except IndexError: raise ValueError(f"Needed an even number of values, got {len(data)}") diff --git a/concoursetools/mocking.py b/concoursetools/mocking.py index 323e4df..446a500 100644 --- a/concoursetools/mocking.py +++ b/concoursetools/mocking.py @@ -202,7 +202,7 @@ def _get_folder_as_dict(self, folder_path: Path, max_depth: int = 2, encoding: s first_chunk = rf.read(byte_limit) folder_dict[item.name] = first_chunk elif item.is_dir(): - folder_dict[item.name] = self._get_folder_as_dict(item, max_depth=max_depth-1, encoding=encoding) + folder_dict[item.name] = self._get_folder_as_dict(item, max_depth=max_depth - 1, encoding=encoding) return folder_dict def _set_folder_from_dict(self, folder_path: Path, folder_dict: FolderDict, encoding: str | None = None) -> None: diff --git a/pyproject.toml b/pyproject.toml index 58e11ae..f1f5d2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,14 @@ packages = [ version = {attr = "concoursetools.__version__"} +[tool.autopep8] +max_line_length = 150 +ignore = ["E301", "E501"] +in-place = true +recursive = true +aggressive = 3 + + [tool.coverage.run] command_line = "-m unittest discover" source = ["concoursetools"] diff --git a/tests/test_resource.py b/tests/test_resource.py index 9931c0a..1c79520 100644 --- a/tests/test_resource.py +++ b/tests/test_resource.py @@ -142,7 +142,7 @@ def test_check_step_with_directory_state_capture(self) -> None: def test_check_step_without_version(self) -> None: with self.wrapper.capture_debugging() as debugging: new_version_configs = self.wrapper.fetch_new_versions() - self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) + self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) self.assertEqual(debugging, "") def test_in_step_no_directory_state(self) -> None: @@ -339,7 +339,7 @@ def test_check_step_with_directory_state_capture(self) -> None: def test_check_step_without_version(self) -> None: with self.wrapper.capture_debugging() as debugging: new_version_configs = self.wrapper.fetch_new_versions() - self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) + self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) self.assertEqual(debugging, "") def test_in_step_no_directory_state(self) -> None: @@ -538,7 +538,7 @@ def test_check_step_with_directory_state_capture(self) -> None: def test_check_step_without_version(self) -> None: with self.wrapper.capture_debugging() as debugging: new_version_configs = self.wrapper.fetch_new_versions() - self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) + self.assertListEqual(new_version_configs, [{"ref": "61cbef"}, {"ref": "d74e01"}, {"ref": "7154fe"}]) self.assertEqual(debugging, "") def test_in_step_no_directory_state(self) -> None: From e070bf4e942f73772b483d307ad00fa94dfdcec9 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 10:46:36 +0100 Subject: [PATCH 06/10] Bumped pre-commit versions --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fb7bdc..4194343 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: - id: autopep8 exclude: docs/source/conf.py - repo: https://github.com/pycqa/isort - rev: 6.0.0 + rev: 6.0.1 hooks: - id: isort - repo: https://github.com/jumanjihouse/pre-commit-hooks @@ -33,12 +33,12 @@ repos: - id: forbid-crlf - id: forbid-tabs - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.17.2 + rev: v9.0.1 hooks: - id: cspell exclude: \.gitignore|.*\.properties - repo: https://github.com/pycqa/flake8 - rev: 7.1.2 + rev: 7.2.0 hooks: - id: flake8 args: [--max-line-length=150] From a37eeb62d94bf9d468433471a82dd50e3bbdfe3a Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 10:47:08 +0100 Subject: [PATCH 07/10] Renamed 'whats_new' to 'changelog' --- docs/source/{whats_new.rst => changelog.rst} | 2 +- docs/source/{whats_new => changelog}/0.8.0.rst | 0 docs/source/index.rst | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename docs/source/{whats_new.rst => changelog.rst} (75%) rename docs/source/{whats_new => changelog}/0.8.0.rst (100%) diff --git a/docs/source/whats_new.rst b/docs/source/changelog.rst similarity index 75% rename from docs/source/whats_new.rst rename to docs/source/changelog.rst index 274f243..90129b2 100644 --- a/docs/source/whats_new.rst +++ b/docs/source/changelog.rst @@ -4,4 +4,4 @@ What's New .. toctree:: :glob: - whats_new/* + changelog/* diff --git a/docs/source/whats_new/0.8.0.rst b/docs/source/changelog/0.8.0.rst similarity index 100% rename from docs/source/whats_new/0.8.0.rst rename to docs/source/changelog/0.8.0.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index dad63f8..c251d77 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -49,7 +49,7 @@ Contents testing deployment internals - whats_new + changelog .. toctree:: :caption: Examples From 5908a5304e58995212f76958867470f5062383fb Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 10:58:22 +0100 Subject: [PATCH 08/10] Minor changes and additions to the Contributors guide to address the style guide. --- CONTRIBUTING.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8646091..862a4bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,8 @@ To run the checks at any time: $ pre-commit run --all-files ``` +Please do not add any new pre-commit checks yourself and instead raise a ticket. + ### Tests Before opening a pull request, please ensure that the tests pass. To do this, run the following: @@ -80,11 +82,20 @@ $ python3 -m sphinx -b linkcheck docs/source docs/build # check that all links ## Coding Standards and Conventions -Concourse Tools is a fully-typed library, so please ensure all functions, methods and classes are fully typed. Although -we tend to make use of future annotations (`from __future__ import annotations`) please continue using the `typing` -module for all types to ensure compatibility with our documentation. +Concourse Tools is a fully-typed library, so please ensure all functions, methods and classes are fully typed. Concourse Tools uses [Sphinx-style docstrings](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html). This project aims to depend only on the standard library, so contributions which add additional dependencies outside of the standard library are likely to be rejected unless absolutely necessary. + + +### Style Guide + +Concourse Tools does not have an explicit style guide outside of the pre-commit checks for enforcing PEP8 and double-quote strings. +However, please ensure your code is as readable and clear as possible. Reviewers will highlight any code changes they feel +is inconsistent or difficult to parse. + +Please refrain from running Black over the code, as it can cause readability issues for nested statements. + +Finally, please do not refactor "other people's" code when submitting a pull request. From 32ad1504f81a7fa967b7f13757b9e1d5ae4cd814 Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 11:23:40 +0100 Subject: [PATCH 09/10] Added 'superuser.com' to linkcheck ignore --- docs/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 921b4e4..6b29ebc 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -82,6 +82,7 @@ def typehints_formatter(annotation: Any, config: sphinx.config.Config) -> str | linkcheck_report_timeouts_as_broken = False # silences a warning: https://github.com/sphinx-doc/sphinx/issues/11868 linkcheck_anchors_ignore_for_url = [ "https://github.com/.*", + "https://superuser.com/.*", ] intersphinx_mapping = { From 0b06c663099c6be645ecece26e8fee0f0ed4a1bb Mon Sep 17 00:00:00 2001 From: gchqdev227 <62302861+gchqdev227@users.noreply.github.com> Date: Fri, 16 May 2025 13:31:10 +0100 Subject: [PATCH 10/10] Moved broken link into linkcheck_ignore conf variable --- docs/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 6b29ebc..bd01cc6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -82,6 +82,8 @@ def typehints_formatter(annotation: Any, config: sphinx.config.Config) -> str | linkcheck_report_timeouts_as_broken = False # silences a warning: https://github.com/sphinx-doc/sphinx/issues/11868 linkcheck_anchors_ignore_for_url = [ "https://github.com/.*", +] +linkcheck_ignore = [ "https://superuser.com/.*", ]