Skip to content

Commit

Permalink
Revert black's line length and apply black
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro Lapshyn committed Dec 16, 2020
1 parent a0f847e commit 6b7f162
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 19 deletions.
12 changes: 6 additions & 6 deletions jira_agile_metrics/calculators/cycletime.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def write(self):

def calculate_cycle_times(
query_manager,
cycle, # [{name:"", statuses:[""], type:""}]
attributes, # [{key:value}]
committed_column, # "" in `cycle`
done_column, # "" in `cycle`
queries, # [{jql:"", value:""}]
query_attribute=None, # ""
cycle, # [{name:"", statuses:[""], type:""}]
attributes, # [{key:value}]
committed_column, # "" in `cycle`
done_column, # "" in `cycle`
queries, # [{jql:"", value:""}]
query_attribute=None, # ""
now=None,
):

Expand Down
21 changes: 16 additions & 5 deletions jira_agile_metrics/calculators/cycletime_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def jira(custom_fields):
[("Flagged", None, "Impediment", "customfield_100")],
),
Change(
"2018-01-03 01:00:00", [("Flagged", "Impediment", "", "customfield_100")]
"2018-01-03 01:00:00",
[("Flagged", "Impediment", "", "customfield_100")],
), # blocked 1 day in the backlog
# (doesn't count towards blocked days)
Change(
Expand All @@ -64,13 +65,16 @@ def jira(custom_fields):
],
),
Change(
"2018-01-04 10:01:01", [("Flagged", "", "Impediment", "customfield_100")]
"2018-01-04 10:01:01",
[("Flagged", "", "Impediment", "customfield_100")],
),
Change(
"2018-01-05 08:01:01", [("Flagged", "Impediment", "", "customfield_100")]
"2018-01-05 08:01:01",
[("Flagged", "Impediment", "", "customfield_100")],
), # was blocked 1 day
Change(
"2018-01-08 10:01:01", [("Flagged", "", "Impediment", "customfield_100")]
"2018-01-08 10:01:01",
[("Flagged", "", "Impediment", "customfield_100")],
), # stays blocked until today
],
),
Expand Down Expand Up @@ -178,7 +182,14 @@ def jira(custom_fields):
),
Change(
"2018-01-07 01:01:01",
[("Flagged", None, "Awaiting input", "customfield_100")],
[
(
"Flagged",
None,
"Awaiting input",
"customfield_100",
)
],
),
Change(
"2018-01-10 10:01:01",
Expand Down
36 changes: 32 additions & 4 deletions jira_agile_metrics/calculators/progressreport_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,14 @@ def simple_ql(i, jql):
changes=[
Change(
"2018-01-02 10:01:01",
[("Flagged", None, "Impediment", "customfield_100")],
[
(
"Flagged",
None,
"Impediment",
"customfield_100",
)
],
),
Change(
"2018-01-03 01:00:00",
Expand Down Expand Up @@ -343,7 +350,14 @@ def simple_ql(i, jql):
),
Change(
"2018-01-04 10:01:01",
[("Flagged", None, "Impediment", "customfield_100")],
[
(
"Flagged",
None,
"Impediment",
"customfield_100",
)
],
), # should clear two days later when issue resolved
Change(
"2018-01-05 01:01:01",
Expand Down Expand Up @@ -409,11 +423,25 @@ def simple_ql(i, jql):
),
Change(
"2018-01-07 01:01:01",
[("Flagged", None, "Awaiting input", "customfield_100")],
[
(
"Flagged",
None,
"Awaiting input",
"customfield_100",
)
],
),
Change(
"2018-01-10 10:01:01",
[("Flagged", "Awaiting input", "", "customfield_100")],
[
(
"Flagged",
"Awaiting input",
"",
"customfield_100",
)
],
), # blocked 3 days
],
),
Expand Down
1 change: 1 addition & 0 deletions jira_agile_metrics/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(self, fields):

class FauxChangeItem(object):
"""An item in a changelog change"""

def __init__(self, field, fromString, toString, fieldId=None):
self.field = field
self.fieldId = fieldId if fieldId is not None else field
Expand Down
10 changes: 7 additions & 3 deletions jira_agile_metrics/querymanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

logger = logging.getLogger(__name__)


def _field_id_from_changelog_item(history_item):
if hasattr(history_item, 'fieldId'):
if hasattr(history_item, "fieldId"):
return history_item.fieldId
else:
return history_item.field


class IssueSnapshot(object):
"""A snapshot of the key fields of an issue
at a point in its change history"""
Expand Down Expand Up @@ -188,7 +190,7 @@ def iter_changes(self, issue, fields):

field_id = self.field_name_to_id(field)
field_ids_to_names[field_id] = field

initial_value = self.resolve_field_value(issue, field_id)
try:
initial_value = next(
Expand Down Expand Up @@ -227,7 +229,9 @@ def iter_changes(self, issue, fields):
for item in change.items:
if _field_id_from_changelog_item(item) in field_ids_to_names:
yield IssueSnapshot(
change=field_ids_to_names[_field_id_from_changelog_item(item)],
change=field_ids_to_names[
_field_id_from_changelog_item(item)
],
key=issue.key,
date=change_date,
from_string=item.fromString,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
line-length = 179
line-length = 79
include = '\.pyi?$'
exclude = '''
/(
Expand Down

1 comment on commit 6b7f162

@optilude
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you let me know when this is ready to review? I also think it's become detached from the master branch so might need some changes before it will merge.

Please sign in to comment.