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)