From 669bcc0a190ce9921451bad28431886fbaad170b Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sun, 26 Mar 2023 20:12:15 +0200 Subject: [PATCH] Fix typos found by codespell --- .../sphinx13/static/_sphinx_javascript_frameworks_compat.js | 2 +- doc/latex.rst | 2 +- pyproject.toml | 2 +- sphinx/application.py | 4 ++-- sphinx/builders/latex/constants.py | 2 +- sphinx/domains/c.py | 2 +- sphinx/domains/std.py | 2 +- sphinx/ext/apidoc.py | 2 +- sphinx/ext/autodoc/__init__.py | 2 +- sphinx/texinputs/sphinx.sty | 2 +- sphinx/texinputs/sphinxlatexobjects.sty | 2 +- sphinx/texinputs/sphinxlatexshadowbox.sty | 2 +- sphinx/texinputs/sphinxpackageboxes.sty | 6 +++--- tests/roots/test-directive-code/dedent.rst | 4 ++-- tests/test_events.py | 2 +- tests/test_intl.py | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/doc/_themes/sphinx13/static/_sphinx_javascript_frameworks_compat.js b/doc/_themes/sphinx13/static/_sphinx_javascript_frameworks_compat.js index 8549469dc29..f4d3e85f7ac 100644 --- a/doc/_themes/sphinx13/static/_sphinx_javascript_frameworks_compat.js +++ b/doc/_themes/sphinx13/static/_sphinx_javascript_frameworks_compat.js @@ -2,7 +2,7 @@ * _sphinx_javascript_frameworks_compat.js * ~~~~~~~~~~ * - * Compatability shim for jQuery and underscores.js. + * Compatibility shim for jQuery and underscores.js. * * WILL BE REMOVED IN Sphinx 6.0 * xref RemovedInSphinx60Warning diff --git a/doc/latex.rst b/doc/latex.rst index 38e24a7abc8..7e376fff197 100644 --- a/doc/latex.rst +++ b/doc/latex.rst @@ -144,7 +144,7 @@ Keys that you may want to override include: .. hint:: - After modifiying a core LaTeX key like this one, clean up the LaTeX + After modifying a core LaTeX key like this one, clean up the LaTeX build repertory before next PDF build, else left-over auxiliary files are likely to break the build. diff --git a/pyproject.toml b/pyproject.toml index f7d4d05dd3d..ea8ef46a113 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -269,7 +269,7 @@ ignore = [ # pyupgrade "UP031", # replace with format specifiers ] -external = [ # Whitelist for RUF100 unkown code warnings +external = [ # Whitelist for RUF100 unknown code warnings "E704", "W291", "W293", diff --git a/sphinx/application.py b/sphinx/application.py index b824e853297..41aa785d06f 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -970,7 +970,7 @@ def add_js_file(self, filename: str | None, priority: int = 500, :param priority: Files are included in ascending order of priority. If multiple JavaScript files have the same priority, those files will be included in order of registration. - See list of "prority range for JavaScript files" below. + See list of "priority range for JavaScript files" below. :param loading_method: The loading method for the JavaScript file. Either ``'async'`` or ``'defer'`` are allowed. :param kwargs: Extra keyword arguments are included as attributes of the @@ -1035,7 +1035,7 @@ def add_css_file(self, filename: str, priority: int = 500, **kwargs: Any) -> Non :param priority: Files are included in ascending order of priority. If multiple CSS files have the same priority, those files will be included in order of registration. - See list of "prority range for CSS files" below. + See list of "priority range for CSS files" below. :param kwargs: Extra keyword arguments are included as attributes of the ```` tag. diff --git a/sphinx/builders/latex/constants.py b/sphinx/builders/latex/constants.py index 906fd5b771a..ce646d024c8 100644 --- a/sphinx/builders/latex/constants.py +++ b/sphinx/builders/latex/constants.py @@ -1,4 +1,4 @@ -"""consntants for LaTeX builder.""" +"""constants for LaTeX builder.""" from __future__ import annotations diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index 83feeb7e1ca..173db0b80c6 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -98,7 +98,7 @@ _string_re = re.compile(r"[LuU8]?('([^'\\]*(?:\\.[^'\\]*)*)'" r'|"([^"\\]*(?:\\.[^"\\]*)*)")', re.S) -# bool, complex, and imaginary are macro "keywords", so they are handled seperately +# bool, complex, and imaginary are macro "keywords", so they are handled separately _simple_type_specifiers_re = re.compile(r""" \b( void|_Bool diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index a2b1b2ab735..d1a6b048fa9 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -980,7 +980,7 @@ def _resolve_term_xref(self, env: BuildEnvironment, fromdocname: str, if result: return result else: - # fallback to case insentive match + # fallback to case insensitive match if target.lower() in self._terms: docname, labelid = self._terms[target.lower()] return make_refnode(builder, fromdocname, docname, labelid, contnode) diff --git a/sphinx/ext/apidoc.py b/sphinx/ext/apidoc.py index 1097463c6fe..108515d7363 100644 --- a/sphinx/ext/apidoc.py +++ b/sphinx/ext/apidoc.py @@ -175,7 +175,7 @@ def is_skipped_package(dirname: str, opts: Any, excludes: list[str] = []) -> boo files = glob.glob(path.join(dirname, '*.py')) regular_package = any(f for f in files if is_initpy(f)) if not regular_package and not opts.implicit_namespaces: - # *dirname* is not both a regular package and an implicit namespace pacage + # *dirname* is not both a regular package and an implicit namespace package return True # Check there is some showable module inside package diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py index a859ab8379a..f160721960c 100644 --- a/sphinx/ext/autodoc/__init__.py +++ b/sphinx/ext/autodoc/__init__.py @@ -1477,7 +1477,7 @@ def import_object(self, raiseerror: bool = False) -> bool: def _get_signature(self) -> tuple[Any | None, str | None, Signature | None]: if inspect.isNewType(self.object) or isinstance(self.object, TypeVar): - # Supress signature + # Suppress signature return None, None, None def get_user_defined_function_or_method(obj: Any, attr: str) -> Any: diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 6339e50a2bc..6c31f329c65 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -905,7 +905,7 @@ will be set to white}% % than saving the box would-be parameters. Advantage is that this will not % have to be modified if additional keys are added in future (e.g. for % elliptic corners). Storing obeys TeX groups. (these details would be -% relevant only for some genuine independant LaTeX package and manual user +% relevant only for some genuine independent LaTeX package and manual user % authored mark-up, not Sphinx auto mark-up). \newcommand\sphinxboxsetup[1]{% \setkeys{sphinxbox}{#1}% diff --git a/sphinx/texinputs/sphinxlatexobjects.sty b/sphinx/texinputs/sphinxlatexobjects.sty index 1b497111d8f..b4ff1f9d02d 100644 --- a/sphinx/texinputs/sphinxlatexobjects.sty +++ b/sphinx/texinputs/sphinxlatexobjects.sty @@ -119,7 +119,7 @@ \pysig@restore@itemsep@and@parskip } % -% Use a \parbox to accomodate long argument list in signatures +% Use a \parbox to accommodate long argument list in signatures % LaTeX did not imagine that an \item label could need multi-line rendering \newlength{\py@argswidth} \newcommand{\py@sigparams}[2]{% diff --git a/sphinx/texinputs/sphinxlatexshadowbox.sty b/sphinx/texinputs/sphinxlatexshadowbox.sty index bf3decba76d..a2a1a0e393e 100644 --- a/sphinx/texinputs/sphinxlatexshadowbox.sty +++ b/sphinx/texinputs/sphinxlatexshadowbox.sty @@ -24,7 +24,7 @@ % color. % At 6.2.0, \spx@ShadowFBox is so much simplified that it is now not -% separatedly defined but directly incorporated into the \FrameCommand +% separately defined but directly incorporated into the \FrameCommand % definition done by sphinxShadowBox environment below. % Use framed.sty \MakeFramed/\endMakeFramed to allow page breaks for topic diff --git a/sphinx/texinputs/sphinxpackageboxes.sty b/sphinx/texinputs/sphinxpackageboxes.sty index ae2db223e4c..b0d3707062f 100644 --- a/sphinx/texinputs/sphinxpackageboxes.sty +++ b/sphinx/texinputs/sphinxpackageboxes.sty @@ -23,7 +23,7 @@ % pict2e. Actually since 6.0.0 the default is for code-blocks to use % rounded boxes, and the only reason since then to wait "at begin document" % was to check if user had reverted that default and in fact pict2e was not -% neeeded. But with \sphinxbox, we can not know for sure even in that case +% needed. But with \sphinxbox, we can not know for sure even in that case % that pict2e is not needed. And even back then it would have been possible % to user to try to employ \sphinxsetup via raw directive in document body % and require some rounded corners (which was thus impossible to satisfy). @@ -40,7 +40,7 @@ }% % Formerly a \sphinxbuildwarning was issued but if we did that now it % would mean that the produced PDF will always have a red banner near its - % end about pict2e not being avalable if indeed it is not available, even + % end about pict2e not being available if indeed it is not available, even % if user has reverted the default and dropped rounded corners. Formerly % the serious warning was done after having checked at begin document that % indeed a rounded corner option had been used. As we drop the check now, @@ -392,7 +392,7 @@ % needed which also contains the whole of pgf/TikZ... so this point % is a bit moot... -% For code-blocks, attachements of caption and continuation hints are done +% For code-blocks, attachments of caption and continuation hints are done % exactly as prior to extension of Sphinx via this package, whether the box % has straight or rounded corners. The vertical space occupied is the same, % if nothing else is changed (perhaps in future the title itself could be also diff --git a/tests/roots/test-directive-code/dedent.rst b/tests/roots/test-directive-code/dedent.rst index f36e3e3ba83..66ac91c0052 100644 --- a/tests/roots/test-directive-code/dedent.rst +++ b/tests/roots/test-directive-code/dedent.rst @@ -8,7 +8,7 @@ dedent option Third line Fourth line -ReST has no fixed indent and only a change in indention is significant not the amount [1]_. +ReST has no fixed indent and only a change in indentation is significant not the amount [1]_. Thus, the following code inside the code block is not indent even it looks so with respect to the previous block. .. code-block:: @@ -41,7 +41,7 @@ The code has 6 spaces indent, minus 4 spaces dedent should yield a 2 space inden Dedenting by zero, should not strip any spaces and be a no-op. .. note:: - This can be used as an alternative to ``:class: dummy`` above, to fixate the ReST indention of the block. + This can be used as an alternative to ``:class: dummy`` above, to fixate the ReST indentation of the block. .. code-block:: :dedent: 0 diff --git a/tests/test_events.py b/tests/test_events.py index 8f01a673a9f..d850a91a548 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -11,7 +11,7 @@ def test_event_priority(): events = EventManager(object()) # pass an dummy object as an app events.connect('builder-inited', lambda app: result.append(1), priority = 500) events.connect('builder-inited', lambda app: result.append(2), priority = 500) - events.connect('builder-inited', lambda app: result.append(3), priority = 200) # eariler + events.connect('builder-inited', lambda app: result.append(3), priority = 200) # earlier events.connect('builder-inited', lambda app: result.append(4), priority = 700) # later events.connect('builder-inited', lambda app: result.append(5), priority = 500) diff --git a/tests/test_intl.py b/tests/test_intl.py index a588aef4b27..feabe0e62de 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -596,7 +596,7 @@ def test_gettext_literalblock(app): actual = read_po(app.outdir / 'literalblock.pot') for expect_msg in [m for m in expect if m.id]: if len(expect_msg.id.splitlines()) == 1: - # compare tranlsations only labels + # compare translations only labels assert expect_msg.id in [m.id for m in actual if m.id] else: pass # skip code-blocks and literalblocks