From 13d25d96bf8c2a1ff688d7a0463d90cfb9924b51 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:21:01 +0000 Subject: [PATCH] Enable automatic formatting for ``sphinx/ext/githubpages.py`` --- .ruff.toml | 1 - sphinx/ext/githubpages.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.ruff.toml b/.ruff.toml index 155dd07bd2f..af6d2608148 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -415,7 +415,6 @@ exclude = [ "sphinx/domains/python/_object.py", "sphinx/domains/rst.py", "sphinx/domains/std/__init__.py", - "sphinx/ext/githubpages.py", "sphinx/ext/graphviz.py", "sphinx/ext/ifconfig.py", "sphinx/ext/imgconverter.py", diff --git a/sphinx/ext/githubpages.py b/sphinx/ext/githubpages.py index aac47975a14..8aec8b77efb 100644 --- a/sphinx/ext/githubpages.py +++ b/sphinx/ext/githubpages.py @@ -43,8 +43,8 @@ def create_nojekyll_and_cname(app: Sphinx, env: BuildEnvironment) -> None: domain = _get_domain_from_url(app.config.html_baseurl) # Filter out GitHub Pages domains, as they do not require CNAME files. - if domain and not domain.endswith(".github.io"): - with open(cname_path, 'w', encoding="utf-8") as f: + if domain and not domain.endswith('.github.io'): + with open(cname_path, 'w', encoding='utf-8') as f: # NOTE: don't write a trailing newline. The `CNAME` file that's # auto-generated by the GitHub UI doesn't have one. f.write(domain)