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

Apply pre-commit to all files #11201

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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 common
Submodule common updated 1 files
+7 −1 pre-commit-config.yaml
2 changes: 1 addition & 1 deletion docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
text-rendering: auto;
-webkit-font-smoothing: antialiased;

}
}
1 change: 0 additions & 1 deletion media/css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@
.ui-autocomplete { background: #fff; text-align: left; border: 1px solid #bfbfbf; }
.ui-state-hover { background: #eee; }
.ui-menu-item a { display: block; padding: 3px 10px; }

2 changes: 1 addition & 1 deletion media/javascript/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,4 +512,4 @@ var Search = {

$(document).ready(function() {
Search.init();
});
});
2 changes: 1 addition & 1 deletion readthedocs/api/v3/proxied_views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from readthedocs.core.mixins import ProxiedAPIMixin
from readthedocs.core.utils.extend import SettingsOverrideObject
from readthedocs.embed.v3.views import EmbedAPIBase
from readthedocs.core.mixins import ProxiedAPIMixin


class ProxiedEmbedAPIBase(ProxiedAPIMixin, EmbedAPIBase):
Expand Down
5 changes: 3 additions & 2 deletions readthedocs/api/v3/tests/test_environmentvariables.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from .mixins import APIEndpointMixin
import django_dynamic_fixture as fixture
from django.urls import reverse

import django_dynamic_fixture as fixture
from readthedocs.projects.models import EnvironmentVariable

from .mixins import APIEndpointMixin


class EnvironmentVariablessEndpointTests(APIEndpointMixin):
def setUp(self):
Expand Down
11 changes: 4 additions & 7 deletions readthedocs/api/v3/tests/test_remoteorganizations.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from django.urls import reverse

from allauth.socialaccount.models import SocialAccount
import django_dynamic_fixture as fixture
from allauth.socialaccount.models import SocialAccount
from django.urls import reverse

from readthedocs.oauth.constants import GITHUB
from readthedocs.oauth.models import (
RemoteOrganization,
RemoteOrganizationRelation,
)
from readthedocs.oauth.models import RemoteOrganization, RemoteOrganizationRelation

from .mixins import APIEndpointMixin


Expand Down
6 changes: 3 additions & 3 deletions readthedocs/api/v3/tests/test_remoterepositories.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.urls import reverse

from allauth.socialaccount.models import SocialAccount
import django_dynamic_fixture as fixture
from allauth.socialaccount.models import SocialAccount
from django.urls import reverse

from readthedocs.oauth.constants import GITHUB
from readthedocs.oauth.models import (
Expand All @@ -11,6 +10,7 @@
RemoteRepositoryRelation,
)
from readthedocs.projects.constants import REPO_TYPE_GIT

from .mixins import APIEndpointMixin


Expand Down
1 change: 0 additions & 1 deletion readthedocs/audit/apps.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Audit module."""

import structlog

from django.apps import AppConfig

log = structlog.get_logger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/audit/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
user_logged_out,
user_login_failed,
)
from django.dispatch import receiver
from django.db.models import Q
from django.dispatch import receiver

from readthedocs.audit.models import AuditLog

Expand Down
1 change: 0 additions & 1 deletion readthedocs/builds/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import django.dispatch


build_complete = django.dispatch.Signal()
# Useful to know when to purge the footer
version_changed = django.dispatch.Signal()
1 change: 0 additions & 1 deletion readthedocs/builds/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.urls import re_path
from django.views.generic.base import RedirectView


urlpatterns = [
re_path(
r"^(?P<project_slug>[-\w]+)/(?P<build_pk>\d+)/$",
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/core/history.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import structlog
from functools import partial

import structlog
from django import forms
from django.db import models
from django.utils.translation import gettext_lazy as _
Expand Down
3 changes: 2 additions & 1 deletion readthedocs/core/management/commands/collectstatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"""

from django.contrib.staticfiles.management.commands import collectstatic
from readthedocs.core.signals import pre_collectstatic, post_collectstatic

from readthedocs.core.signals import post_collectstatic, pre_collectstatic


class Command(collectstatic.Command):
Expand Down
4 changes: 1 addition & 3 deletions readthedocs/core/utils/contact.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import structlog

import markdown
import structlog
from django.conf import settings
from django.core.mail import send_mail
from django.template import Context, Engine


log = structlog.get_logger(__name__)


Expand Down
1 change: 0 additions & 1 deletion readthedocs/doc_builder/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from django.conf import settings


# Managers
mkdocs = import_module(settings.MKDOCS_BACKEND)
sphinx = import_module(settings.SPHINX_BACKEND)
Expand Down
1 change: 1 addition & 0 deletions readthedocs/embed/v3/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import shutil

import pytest

from .utils import srcdir
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import json

from django.db.models import Q, Subquery
from django.core.management.base import BaseCommand
from django.db.models import Q, Subquery

from readthedocs.oauth.models import RemoteRepository
from readthedocs.oauth.services import registry
from readthedocs.oauth.services.base import SyncServiceError
from readthedocs.projects.models import Project
from readthedocs.organizations.models import Organization
from readthedocs.projects.models import Project


class Command(BaseCommand):
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/oauth/management/commands/sync_vcs_data.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import datetime
import json

from django.utils import timezone
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from django.utils import timezone

from readthedocs.oauth.tasks import sync_remote_repositories

Expand Down
1 change: 0 additions & 1 deletion readthedocs/organizations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from readthedocs.builds.models import Build
from readthedocs.worker import app


log = structlog.get_logger(__name__)


Expand Down
1 change: 0 additions & 1 deletion readthedocs/profiles/urls/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from readthedocs.profiles import views


urlpatterns = [
re_path(
r"^(?P<username>[+\[email protected]]+)/$",
Expand Down
2 changes: 1 addition & 1 deletion readthedocs/projects/static-src/projects/css/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
}
}

}
}
2 changes: 1 addition & 1 deletion readthedocs/projects/tag_utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Customizations to Django Taggit."""
import requests
from allauth.socialaccount.models import SocialApp
from django.db.models import Count
from django.utils.text import slugify
import requests
from taggit.models import Tag
from taggit.utils import _parse_tags

Expand Down
2 changes: 1 addition & 1 deletion readthedocs/rtd_tests/base.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Base classes and mixins for unit tests."""
import structlog
from collections import OrderedDict
from unittest.mock import patch

import structlog
from django.contrib.auth.models import AnonymousUser
from django.contrib.messages.storage.fallback import FallbackStorage
from django.contrib.sessions.middleware import SessionMiddleware
Expand Down
2 changes: 0 additions & 2 deletions readthedocs/rtd_tests/files/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from __future__ import division, print_function, unicode_literals

from datetime import datetime

from recommonmark.parser import CommonMarkParser
Expand Down
1 change: 0 additions & 1 deletion readthedocs/rtd_tests/tests/test_api_permissions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from functools import partial
from unittest import TestCase

from unittest.mock import Mock

from readthedocs.api.v2.permissions import ReadOnlyPermission
Expand Down
1 change: 0 additions & 1 deletion readthedocs/search/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from django.db.models.functions import TruncDate
from django.utils import timezone
from django.utils.translation import gettext_lazy as _

from django_extensions.db.models import TimeStampedModel

from readthedocs.builds.models import Version
Expand Down
1 change: 0 additions & 1 deletion readthedocs/search/tasks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import structlog

from dateutil.parser import parse
from django.apps import apps
from django.conf import settings
Expand Down
4 changes: 2 additions & 2 deletions readthedocs/search/tests/test_search_tasks.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Tests for search tasks."""

from unittest import mock
import pytest

import pytest
from django.urls import reverse
from django.utils import timezone

from readthedocs.search.models import SearchQuery
from readthedocs.search import tasks
from readthedocs.search.models import SearchQuery


@pytest.mark.django_db
Expand Down
2 changes: 0 additions & 2 deletions readthedocs/sso/admin.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
"""Admin interface for SSO models."""
import structlog

from django.contrib import admin, messages

from readthedocs.core.permissions import AdminPermission
from readthedocs.oauth.tasks import sync_remote_repositories

from .models import SSODomain, SSOIntegration


log = structlog.get_logger(__name__)


Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from setuptools import setup


# Configuration is in setup.cfg
setup()