Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish codespell -- Concludes #8409 #8421

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readthedocs/api/v2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def sync_versions_to_db(project, versions, type): # pylint: disable=redefined-b
- it does not delete versions

:param project: project to update versions
:param versions: list of VCSVersion fetched from the respository
:param versions: list of VCSVersion fetched from the repository
:param type: internal or external version
:returns: set of versions' slug added
"""
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/v2/views/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ class WebhookView(APIView):
be.
.. warning::
We're turning off Authenication for this view.
We're turning off Authentication for this view.
This fixes a bug where we were double-authenticating these views,
because of the way we're passing the request along to the subviews.
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/v3/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class CommonPermissionsBase(BasePermission):
Common permission class used for most APIv3 endpoints.

This class should be used by ``APIv3Settings.permission_classes`` to define
the permissions for most APIv3 endpoints. It has to be overriden from
the permissions for most APIv3 endpoints. It has to be overridden from
corporate to define proper permissions there.
"""

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/v3/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DocsAPIRootView(APIRootView):
"""
Read the Docs APIv3 root endpoint.

The API is browseable by sending the header ``Authorization: Token <token>`` on each request. You can find your Token at [https://readthedocs.org/accounts/tokens/](https://readthedocs.org/accounts/tokens/).
The API is browsable by sending the header ``Authorization: Token <token>`` on each request. You can find your Token at [https://readthedocs.org/accounts/tokens/](https://readthedocs.org/accounts/tokens/).

Read its full documentation at [https://docs.readthedocs.io/page/api/v3.html](https://docs.readthedocs.io/page/api/v3.html).
""" # noqa
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/v3/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_success(self, obj):
"""
Return ``None`` if the build is not finished.

This is needed becase ``default=True`` in the model field.
This is needed because ``default=True`` in the model field.
"""
if obj.finished:
return obj.success
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/api/v3/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def get_view_name(self):
return f'Organizations {self.suffix}'

def get_queryset(self):
# Allow hitting ``/api/v3/organizations/`` to list their own organizaions
# Allow hitting ``/api/v3/organizations/`` to list their own organizations
if self.basename == 'organizations' and self.action == 'list':
# We force returning ``Organization`` objects here because it's
# under the ``organizations`` view.
Expand Down
6 changes: 3 additions & 3 deletions readthedocs/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class BuildConfigBase:
You need to call ``validate`` before the config is ready to use.
:param env_config: A dict that cointains additional information
:param env_config: A dict that contains additional information
about the environment.
:param raw_config: A dict with all configuration without validation.
:param source_file: The file that contains the configuration.
Expand Down Expand Up @@ -1026,8 +1026,8 @@ def validate_submodules(self):
"""
Validates the submodules key.
- We can use the ``ALL`` keyword in include or exlude.
- We can't exlude and include submodules at the same time.
- We can use the ``ALL`` keyword in include or exclude.
- We can't exclude and include submodules at the same time.
"""
raw_submodules = self._raw_config.get('submodules', {})
with self.catch_validation_error('submodules'):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Base:
Base class for every configuration.
Each inherited class should define
its attibutes in the `__slots__` attribute.
its attributes in the `__slots__` attribute.
We are using `__slots__` so we can't add more attributes by mistake,
this is similar to a namedtuple.
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/config/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def validate_path_pattern(value):
- Checks the final path is relative to the root of the site ``/``.
"""
path = validate_string(value)
# Start the path with ``/`` to interprete the path as absolute to ``/``.
# Start the path with ``/`` to interpret the path as absolute to ``/``.
path = '/' + path.lstrip('/')
path = os.path.normpath(path)
if not os.path.isabs(path):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/core/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Common utilty functions."""
"""Common utility functions."""

import datetime
import errno
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/embed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class EmbedAPI(SettingsOverrideObject):


def do_embed(*, project, version, doc=None, path=None, section=None, url=None):
"""Get the embed reponse from a document section."""
"""Get the embed response from a document section."""
if not url:
external = version.type == EXTERNAL
url = resolve(
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/organizations/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def _create_default_teams(organization):
def save(self, commit=True):
org = super().save(commit)

# If not commiting, we can't save M2M fields
# If not committing, we can't save M2M fields
if not commit:
return org

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ def get_translation_queryset(self):
def save(self, commit=True):
if commit:
# Don't use ``self.parent.translations.add()`` here as this
# triggeres a problem with database routing and multiple databases.
# triggers a problem with database routing and multiple databases.
# Directly set the ``main_language_project`` instead of doing a
# bulk update.
self.translation.main_language_project = self.parent
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ def add_features(sender, **kwargs):
SKIP_SYNC_BRANCHES = 'skip_sync_branches'
SKIP_SYNC_VERSIONS = 'skip_sync_versions'

# Dependecies related features
# Dependencies related features
PIP_ALWAYS_UPGRADE = 'pip_always_upgrade'
USE_NEW_PIP_RESOLVER = 'use_new_pip_resolver'
DONT_INSTALL_LATEST_PIP = 'dont_install_latest_pip'
Expand Down Expand Up @@ -1740,7 +1740,7 @@ def add_features(sender, **kwargs):
_('Skip sync versions task'),
),

# Dependecies related features
# Dependencies related features
(PIP_ALWAYS_UPGRADE, _('Always run pip install --upgrade')),
(USE_NEW_PIP_RESOLVER, _('Use new pip resolver')),
(
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def update_docs_task(self, version_pk, *args, **kwargs):
def sigterm_received(*args, **kwargs):
log.warning('SIGTERM received. Waiting for build to stop gracefully after it finishes.')

# Do not send the SIGTERM signal to childs (pip is automatically killed when
# Do not send the SIGTERM signal to children (pip is automatically killed when
# receives SIGTERM and make the build to fail one command and stop build)
signal.signal(signal.SIGTERM, sigterm_received)

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/proxito/tests/test_old_redirects.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def test_not_found_page_without_trailing_slash(self):


# FIXME: these tests are valid, but the problem I'm facing is that the request
# is received as ``GET '//my.host/path/'`` (note that we are loosing the http:)
# is received as ``GET '//my.host/path/'`` (note that we are losing the http:)
@pytest.mark.xfail(strict=True)
class UserRedirectCrossdomainTest(BaseDocServing):

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/proxito/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_redirect_response(self, request, redirect_path, proxito_path, http_statu
"""
Build the response for the ``redirect_path``, ``proxito_path`` and its ``http_status``.
:returns: redirect respose with the correct path
:returns: redirect response with the correct path
:rtype: HttpResponseRedirect or HttpResponsePermanentRedirect
"""

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _has_permission(self, user, version):
Check if `user` is authorized to access `version`.

The queryset from `_get_subproject_version` already filters public
projects. This is mainly to be overriden in .com to make use of
projects. This is mainly to be overridden in .com to make use of
the auth backends in the proxied API.
"""
return True
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/search/faceted_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(

filters = filters or {}

# We may recieve invalid filters
# We may receive invalid filters
valid_filters = {
k: v
for k, v in filters.items()
Expand Down Expand Up @@ -218,7 +218,7 @@ def _is_advanced_query(self, query):
return not tokens.isdisjoint(query_tokens)

def aggregate(self, search):
"""Overriden to decide if we should aggregate or not."""
"""Overridden to decide if we should aggregate or not."""
if self.aggregate_results:
super().aggregate(search)

Expand Down
4 changes: 2 additions & 2 deletions readthedocs/search/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _clean_body(self, body):
"""
Removes sphinx domain nodes.

This method is overriden to remove contents that are likely
This method is overridden to remove contents that are likely
to be a sphinx domain (`dl` tags).
We already index those in another step.
"""
Expand Down Expand Up @@ -585,7 +585,7 @@ def _process_index_file(self, json_path, page):
path = parsed_path.path

# Some old versions of mkdocs
# index the pages as ``/page.html`` insted of ``page.html``.
# index the pages as ``/page.html`` instead of ``page.html``.
path = path.lstrip('/')

if path == '' or path.endswith('/'):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/search/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_remove_only_one_version_index(self, api_client, all_projects):
time.sleep(1)

assert self.has_results(api_client, project, LATEST) is False
# Ony latest was deleted.
# Only latest was deleted.
assert self.has_results(api_client, project, STABLE) is True

for project in ['pipeline', 'docs']:
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def DOCKER_LIMITS(self):
process per server, which will be allowed to consume all available
memory.
We substract 750MiB for overhead of processes and base system, and set
We subtract 750MiB for overhead of processes and base system, and set
the build time as proportional to the memory limit.
"""
# Our normal default
Expand Down Expand Up @@ -609,7 +609,7 @@ def DOCKER_LIMITS(self):
'authorization',
'x-csrftoken'
)
# Additional protecion to allow only idempotent methods.
# Additional protection to allow only idempotent methods.
CORS_ALLOW_METHODS = [
'GET',
'OPTIONS',
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/templates/account/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1>{% trans "Sign Up" %}</h1>
{% blocktrans trimmed %}
Sign up using the following provider.
If you don't have an account with this provider,
please contant your organization owner and ask about this.
please contact your organization owner and ask about this.
{% endblocktrans %}
</p>
{% else %}
Expand Down
8 changes: 4 additions & 4 deletions readthedocs/vcs_support/backends/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def validate_submodules(self, config):
.. note::
Allways call after `self.are_submodules_available`.
Always call after `self.are_submodules_available`.
:returns: tuple(bool, list)
Expand All @@ -107,7 +107,7 @@ def validate_submodules(self, config):
- Include is `ALL`, returns all submodules available.
- Include is a list, returns just those.
- Exclude is `ALL` - this should never happen.
- Exlude is a list, returns all available submodules
- Exclude is a list, returns all available submodules
but those from the list.
Returns `False` if at least one submodule is invalid.
Expand Down Expand Up @@ -206,7 +206,7 @@ def clone(self):
@property
def lsremote(self):
"""
Use ``git ls-remote`` to list branches and tags without clonning the repository.
Use ``git ls-remote`` to list branches and tags without cloning the repository.
:returns: tuple containing a list of branch and tags
"""
Expand Down Expand Up @@ -242,7 +242,7 @@ def tags(self):
# GitPython is not very optimized for reading large numbers of tags
ref_cache = {} # 'ref/tags/<tag>' -> hexsha
# This code is the same that is executed for each tag in gitpython,
# we excute it only once for all tags.
# we execute it only once for all tags.
for hexsha, ref in git.TagReference._iter_packed_refs(repo):
gitobject = git.Object.new_from_sha(repo, hex_to_bin(hexsha))
if gitobject.type == 'commit':
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/vcs_support/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class BaseVCS:
supports_branches = False # Whether this VCS supports branches or not.
supports_submodules = False

# Whether this VCS supports listing remotes (branches, tags) without clonning
# Whether this VCS supports listing remotes (branches, tags) without cloning
supports_lsremote = False

# =========================================================================
Expand All @@ -67,7 +67,7 @@ def __init__(
self.verbose_name = verbose_name
self.version_type = version_type

# TODO: always pass an explict environment
# TODO: always pass an explicit environment
# This is only used in tests #6546
from readthedocs.doc_builder.environments import LocalBuildEnvironment
self.environment = environment or LocalBuildEnvironment(record=False)
Expand Down