Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
javatarz committed Oct 13, 2019
1 parent 01b1490 commit 0a1aea5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion client/contributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _user_score(self, user_id: str, start_date: datetime = None, end_date: datet

@staticmethod
def _filter_prs(prs: List[PullRequest], start_date: datetime = None, end_date: datetime = None) -> List[PullRequest]:
if start_date != None and end_date != None:
if start_date is not None and end_date is not None:
return [pr for pr in prs if pr.created_between(start_date, end_date)]
else:
return prs
Expand Down
4 changes: 2 additions & 2 deletions client/github_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def list_of_prs(self, user_id: str, state=None, request_parallelization_count=5)
prs = Pool(request_parallelization_count).map(
self._to_pull_request, items)

if state == None:
if state is None:
return prs
else:
def stateNotEqual(pr: PullRequest) -> Boolean:
def stateNotEqual(pr: PullRequest) -> bool:
return pr._state != state

return filter(stateNotEqual, prs)
Expand Down
4 changes: 2 additions & 2 deletions client_test/models/pr_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class PRData:
def __init__(self, data: dict = None):
if data == None:
if data is None:
with open('./client_test/models/empty_pr_data.json') as file:
self.data = json.load(file)
else:
Expand All @@ -17,7 +17,7 @@ def with_pr_url(self, url: str = 'some-url'):

def with_label(self, label_to_add: str = None):
data = copy.deepcopy(self.data)
if label_to_add == None:
if label_to_add is None:
label_number = len(data["issues_data"]["labels"]) + 1
label_to_add = f'label-{label_number}'

Expand Down
6 changes: 3 additions & 3 deletions client_test/models/pull_request_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_should_create_pull_request():
assert pr._created_at == datetime(2014, 4, 24, 16, 34, 47)
assert pr._owner == 'owner_user_id'
assert pr._pr_raised_by == 'pr_raised_by_user_id'
assert pr._merged == False
assert pr._merged is False

@staticmethod
def test_summary():
Expand All @@ -34,7 +34,7 @@ def test_should_not_be_spam_when_labels_do_not_contain_invalid_and_spam():
data = _input.data
pr = PullRequest(**data)

assert pr.is_spam() == False
assert pr.is_spam() is False

@staticmethod
def test_should_be_spam_when_labels_contain_invalid():
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_not_in_between():
assert pr.created_between(
start_date=datetime(2020, 1, 1),
end_date=datetime(2021, 1, 1)
) == False
) is False

@staticmethod
def test_created_at_start():
Expand Down
3 changes: 0 additions & 3 deletions stats.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import sys
from argparse import ArgumentParser, ArgumentTypeError
from datetime import datetime
from typing import List

from client.contributions import Contributions
from client.github_stats import GithubStats
from client.models.user_stats import UserStats


def valid_date(s: str) -> datetime:
Expand Down

0 comments on commit 0a1aea5

Please sign in to comment.