Skip to content

Commit 5960126

Browse files
committed
Reformat with single quotes
1 parent 12c8fd6 commit 5960126

File tree

41 files changed

+484
-479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+484
-479
lines changed

.ruff.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ line-length = 88
33
output-format = "full"
44

55
[format]
6-
quote-style = "double"
6+
quote-style = "single"
77
docstring-code-format = true
88

99
[lint]
@@ -83,6 +83,9 @@ ignore = [
8383
"SLF001", # allow private member access
8484
]
8585

86+
[lint.flake8-quotes]
87+
inline-quotes = "single"
88+
8689
[lint.flake8-type-checking]
8790
exempt-modules = []
8891
strict = true

docs/conf.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
# -- Project information -----------------------------------------------------
2020

21-
project = "sphinxext-opengraph"
21+
project = 'sphinxext-opengraph'
2222
copyright = (
23-
"2020, FIRST",
24-
"2025-%Y, the Sphinx developers",
23+
'2020, FIRST',
24+
'2025-%Y, the Sphinx developers',
2525
)
2626

2727
version = sphinxext.opengraph.__version__
@@ -33,13 +33,13 @@
3333
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3434
# ones.
3535
extensions = [
36-
"sphinx.ext.intersphinx",
37-
"sphinx_design",
38-
"sphinxext.opengraph",
36+
'sphinx.ext.intersphinx',
37+
'sphinx_design',
38+
'sphinxext.opengraph',
3939
]
4040

4141
# Add any paths that contain templates here, relative to this directory.
42-
templates_path = ["_templates"]
42+
templates_path = ['_templates']
4343

4444
# List of patterns, relative to source directory, that match files and
4545
# directories to ignore when looking for source files.
@@ -51,9 +51,9 @@
5151
# The theme to use for HTML and HTML Help pages. See the documentation for
5252
# a list of builtin themes.
5353
#
54-
html_title = "sphinxext-opengraph"
55-
html_logo = "_static/og-logo.png"
56-
html_theme = "furo"
54+
html_title = 'sphinxext-opengraph'
55+
html_logo = '_static/og-logo.png'
56+
html_theme = 'furo'
5757

5858

5959
intersphinx_mapping = {
@@ -62,16 +62,18 @@
6262

6363
# -- Configuration for this theme --------------------------------------------
6464

65-
ogp_site_url = "https://sphinxext-opengraph.readthedocs.io/en/latest/"
65+
ogp_site_url = 'https://sphinxext-opengraph.readthedocs.io/en/latest/'
6666

6767
# Configuration for testing but generally we use the defaults
6868
# Uncomment lines to see their effect.
6969
ogp_social_cards = {
70-
"site_url": "sphinxext-opengraph.readthedocs.io",
70+
'site_url': 'sphinxext-opengraph.readthedocs.io',
7171
# "image": "TODO: add another image to test",
7272
# "line_color": "#4078c0",
7373
}
7474

7575
# Generate sample social media preview images
76-
path_script = Path(__file__, "..", "script", "generate_social_card_previews.py").resolve()
76+
path_script = Path(
77+
__file__, '..', 'script', 'generate_social_card_previews.py'
78+
).resolve()
7779
run((sys.executable, path_script), check=False) # NoQA: S603

docs/script/generate_social_card_previews.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,37 @@
2929
proident, sunt in culpa qui officia deserunt mollit anim id est laborum""".split()
3030

3131
kwargs_fig = {
32-
"image": PROJECT_ROOT / "docs/_static/og-logo.png",
33-
"image_mini": PROJECT_ROOT / "sphinxext/opengraph/_static/sphinx-logo-shadow.png",
32+
'image': PROJECT_ROOT / 'docs/_static/og-logo.png',
33+
'image_mini': PROJECT_ROOT / 'sphinxext/opengraph/_static/sphinx-logo-shadow.png',
3434
}
3535

36-
print("Generating previews of social media cards...")
36+
print('Generating previews of social media cards...')
3737
plt_objects = create_social_card_objects(**kwargs_fig)
3838
grid_items = []
3939
for perm in range(20):
4040
# Create dummy text description and pagetitle for this iteration
4141
random.shuffle(lorem)
42-
title = " ".join(lorem[:100])
43-
title = title[: MAX_CHAR_PAGE_TITLE - 3] + "..."
42+
title = ' '.join(lorem[:100])
43+
title = title[: MAX_CHAR_PAGE_TITLE - 3] + '...'
4444

4545
random.shuffle(lorem)
46-
desc = " ".join(lorem[:100])
47-
desc = desc[: MAX_CHAR_DESCRIPTION - 3] + "..."
46+
desc = ' '.join(lorem[:100])
47+
desc = desc[: MAX_CHAR_DESCRIPTION - 3] + '...'
4848

49-
path_tmp = Path(PROJECT_ROOT / "docs/tmp")
49+
path_tmp = Path(PROJECT_ROOT / 'docs/tmp')
5050
path_tmp.mkdir(exist_ok=True)
51-
path_out = Path(path_tmp / f"num_{perm}.png")
51+
path_out = Path(path_tmp / f'num_{perm}.png')
5252

5353
plt_objects = render_social_card(
5454
path=path_out,
55-
site_title="Sphinx Social Card Demo",
55+
site_title='Sphinx Social Card Demo',
5656
page_title=title,
5757
description=desc,
58-
siteurl="sphinxext-opengraph.readthedocs.io",
58+
siteurl='sphinxext-opengraph.readthedocs.io',
5959
plt_objects=plt_objects,
6060
)
6161

62-
path_examples_page_folder = PROJECT_ROOT / "docs" / "tmp"
62+
path_examples_page_folder = PROJECT_ROOT / 'docs' / 'tmp'
6363
grid_items.append(f"""\
6464
.. grid-item::
6565
@@ -69,6 +69,6 @@
6969
embed_text = '.. grid:: 2\n :gutter: 5\n\n' + '\n'.join(grid_items)
7070

7171
# Write text that we can use to embed these images in the docs
72-
(PROJECT_ROOT / "docs/tmp/embed.txt").write_text(embed_text)
72+
(PROJECT_ROOT / 'docs/tmp/embed.txt').write_text(embed_text)
7373

74-
print("Done generating previews of social media cards...")
74+
print('Done generating previews of social media cards...')

noxfile.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
@nox.session
2222
def docs(session: nox.Session) -> None:
2323
"""Build the documentation. Use `-- live` to build with a live server."""
24-
session.install("--group", "docs")
25-
session.install("-e", ".")
24+
session.install('--group', 'docs')
25+
session.install('-e', '.')
2626
common_args = '-M', 'html', 'docs', 'docs/build'
27-
if "live" in session.posargs:
28-
session.install("ipython")
29-
session.install("sphinx-autobuild")
27+
if 'live' in session.posargs:
28+
session.install('ipython')
29+
session.install('sphinx-autobuild')
3030
session.run('sphinx-autobuild', *common_args)
3131
else:
3232
session.run('sphinx-build', *common_args, '-nW', '--keep-going')
@@ -35,6 +35,6 @@ def docs(session: nox.Session) -> None:
3535
@nox.session
3636
def test(session: nox.Session) -> None:
3737
"""Run the test suite."""
38-
session.install("-e", ".")
39-
session.install("--group", "test")
40-
session.run("pytest", *session.posargs)
38+
session.install('-e', '.')
39+
session.install('--group', 'test')
40+
session.run('pytest', *session.posargs)

0 commit comments

Comments
 (0)