Skip to content

Commit

Permalink
pre-commit linting
Browse files Browse the repository at this point in the history
  • Loading branch information
chibie committed Nov 29, 2021
1 parent 40b1d32 commit a14998f
Show file tree
Hide file tree
Showing 28 changed files with 30 additions and 45 deletions.
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ repos:
language: system
entry: sh -c 'npm run stylelint:fix'
files: .css$
- repo: git://github.com/pre-commit/mirrors-isort
sha: 'v4.3.4'
hooks:
- id: isort
args:
- --recursive
- --settings-path
- ./setup.cfg
- .
# - repo: git://github.com/pre-commit/mirrors-isort
# sha: 'v4.3.4'
# hooks:
# - id: isort
# args:
# - --recursive
# - --settings-path
# - ./setup.cfg
# - .
2 changes: 1 addition & 1 deletion app/dashboard/sync/helpers.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import logging
from decimal import Decimal

from dashboard.helpers import bounty_activity_event_adapter, get_bounty_data_for_activity
from dashboard.models import Activity, BountyEvent, BountyFulfillment
from decimal import Decimal

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions app/dashboard/tests/factories/fulfillment_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import factory

from dashboard.models import BountyFulfillment

from .bounty_factory import BountyFactory
from .profile_factory import ProfileFactory

Expand All @@ -10,4 +10,4 @@ class Meta:
model = BountyFulfillment

bounty = factory.SubFactory(BountyFactory)
profile = factory.SubFactory(ProfileFactory)
profile = factory.SubFactory(ProfileFactory)
6 changes: 3 additions & 3 deletions app/dashboard/tests/models/test_bounty_fulfillment.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from attr import has
import pytest

from attr import has
from dashboard.models import BountyFulfillment
from dashboard.tests.factories.fulfillment_factory import FulfillmentFactory
from dashboard.tests.factories.bounty_factory import BountyFactory
from dashboard.tests.factories.fulfillment_factory import FulfillmentFactory


@pytest.mark.django_db
class TestBountyFulfillmentProperties:
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/tests/views/test_bounty_payout.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from dashboard.tests.factories import ProfileFactory, BountyFactory, FulfillmentFactory
from dashboard.tests.factories import BountyFactory, FulfillmentFactory, ProfileFactory
from rest_framework.test import APIClient


Expand Down
3 changes: 3 additions & 0 deletions app/grants/templatetags/grants_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@ def modulo(num, val):
return num % val
return 0


@register.simple_tag
def is_team_member(grant, profile):
return is_grant_team_member(grant, profile)


@register.simple_tag
def is_grants_path(path):
return path.lower().startswith('/grants')


@register.simple_tag
def is_favorite(grant, profile):
if profile:
Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/factories/clr_match_factory.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import factory
import pytest

from grants.models.clr_match import CLRMatch

from .contribution_factory import ContributionFactory
Expand Down
2 changes: 1 addition & 1 deletion app/grants/tests/factories/donation_factory.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import factory
import pytest
from dashboard.tests.factories import ProfileFactory
from grants.models.donation import Donation

from .contribution_factory import ContributionFactory
from dashboard.tests.factories import ProfileFactory
from .subscription_factory import SubscriptionFactory


Expand Down
2 changes: 1 addition & 1 deletion app/grants/tests/factories/flag_factory.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import factory
import pytest
from dashboard.tests.factories import ProfileFactory
from grants.models.flag import Flag

from .grant_factory import GrantFactory
from dashboard.tests.factories import ProfileFactory


@pytest.mark.django_db
Expand Down
3 changes: 1 addition & 2 deletions app/grants/tests/factories/grant_api_key_factory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import factory
from grants.models.grant_api_key import GrantAPIKey

from dashboard.tests.factories import ProfileFactory
from grants.models.grant_api_key import GrantAPIKey


class GrantAPIKeyFactory(factory.django.DjangoModelFactory):
Expand Down
3 changes: 1 addition & 2 deletions app/grants/tests/factories/grant_clr_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

import factory
import pytest
from grants.models.grant import GrantCLR

from dashboard.tests.factories import ProfileFactory
from grants.models.grant import GrantCLR


@pytest.mark.django_db
Expand Down
3 changes: 1 addition & 2 deletions app/grants/tests/factories/grant_collection_factory.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import factory
from grants.models.grant_collection import GrantCollection

from dashboard.tests.factories import ProfileFactory
from grants.models.grant_collection import GrantCollection


class GrantCollectionFactory(factory.django.DjangoModelFactory):
Expand Down
2 changes: 1 addition & 1 deletion app/grants/tests/factories/match_pledge_factory.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json

import factory
from dashboard.tests.factories import ProfileFactory
from grants.models.match_pledge import MatchPledge

from .grant_clr_factory import GrantCLRFactory
from dashboard.tests.factories import ProfileFactory


class MatchPledgeFactory(factory.django.DjangoModelFactory):
Expand Down
2 changes: 1 addition & 1 deletion app/grants/tests/factories/subscription_factory.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import factory
from dashboard.tests.factories import ProfileFactory
from grants.models.subscription import Subscription

from .grant_factory import GrantFactory
from dashboard.tests.factories import ProfileFactory


class SubscriptionFactory(factory.django.DjangoModelFactory):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import pytest
from grants.management.commands.grant_collections_shuffle import grant_collection_age_score, grant_meta_data_score

from grants.tests.factories import GrantFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_cart_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from dashboard.models import Profile
from grants.models.cart_activity import CartActivity
from grants.models.grant import Grant

from grants.tests.factories import CartActivityFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_clr_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from grants.models.clr_match import CLRMatch
from grants.models.contribution import Contribution
from grants.models.grant import Grant

from grants.tests.factories import CLRMatchFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from grants.models.contribution import Contribution
from grants.models.donation import Donation
from grants.models.subscription import Subscription

from grants.tests.factories import DonationFactory


Expand Down
3 changes: 1 addition & 2 deletions app/grants/tests/models/test_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
from dashboard.models import Activity, Profile
from grants.models.flag import Flag
from grants.models.grant import Grant
from townsquare.models import Comment

from grants.tests.factories import FlagFactory
from townsquare.models import Comment


@pytest.mark.django_db
Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_grant_api_key.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from dashboard.models import Profile
from grants.models.grant_api_key import GrantAPIKey

from grants.tests.factories import GrantAPIKeyFactory


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest
from grants.models.grant_branding_routing_policy import GrantBrandingRoutingPolicy

from grants.tests.factories import GrantBrandingRoutingPolicyFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_grant_category.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from grants.models.grant_category import GrantCategory

from grants.tests.factories import GrantCategoryFactory


Expand Down
3 changes: 1 addition & 2 deletions app/grants/tests/models/test_grant_clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from grants.models.grant import Grant, GrantCLR
from grants.models.grant_clr_calculation import GrantCLRCalculation
from grants.models.grant_collection import GrantCollection

from grants.tests.factories import GrantFactory, GrantCLRFactory, GrantCollectionFactory
from grants.tests.factories import GrantCLRFactory, GrantCollectionFactory, GrantFactory


@pytest.mark.django_db
Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_grant_clr_calculation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from grants.models.grant import Grant, GrantCLR
from grants.models.grant_clr_calculation import GrantCLRCalculation

from grants.tests.factories import GrantCLRCalculationFactory


Expand Down
5 changes: 2 additions & 3 deletions app/grants/tests/models/test_grant_collection.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import pytest
from dashboard.models import Profile
from dashboard.tests.factories import ProfileFactory
from grants.models.grant import Grant
from grants.models.grant_collection import GrantCollection

from grants.tests.factories import GrantFactory, GrantCollectionFactory
from dashboard.tests.factories import ProfileFactory
from grants.tests.factories import GrantCollectionFactory, GrantFactory


@pytest.mark.django_db
Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_grant_stat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from grants.models.grant import Grant
from grants.models.grant_stat import GrantStat

from grants.tests.factories import GrantStatFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_grant_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from grants.models.grant import GrantCLR
from grants.models.grant_type import GrantType

from grants.tests.factories import GrantTypeFactory


Expand Down
1 change: 0 additions & 1 deletion app/grants/tests/models/test_match_pledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dashboard.models import Profile
from grants.models.grant import GrantCLR
from grants.models.match_pledge import MatchPledge

from grants.tests.factories import MatchPledgeFactory


Expand Down

0 comments on commit a14998f

Please sign in to comment.