Enforce order and style of imports

Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
This commit is contained in:
Chris Hill-Scott
2018-02-20 11:22:17 +00:00
parent 0217a6a962
commit f3a0c505bd
102 changed files with 622 additions and 647 deletions

View File

@@ -1,24 +1,17 @@
import json
from functools import partial
import copy
from unittest.mock import call, ANY
import json
from datetime import datetime
from functools import partial
from unittest.mock import ANY, call
from flask import url_for
import pytest
from bs4 import BeautifulSoup
from flask import url_for
from freezegun import freeze_time
from datetime import datetime
from app.main.views.dashboard import (
get_dashboard_totals,
format_monthly_stats_to_list,
get_free_paid_breakdown_for_billable_units,
aggregate_status_types,
format_template_stats_to_list,
get_tuples_of_financial_years
from tests import (
validate_route_permission,
validate_route_permission_with_client,
)
from tests import validate_route_permission, validate_route_permission_with_client
from tests.conftest import (
SERVICE_ONE_ID,
mock_get_inbound_sms_summary,
@@ -26,6 +19,15 @@ from tests.conftest import (
normalize_spaces,
)
from app.main.views.dashboard import (
aggregate_status_types,
format_monthly_stats_to_list,
format_template_stats_to_list,
get_dashboard_totals,
get_free_paid_breakdown_for_billable_units,
get_tuples_of_financial_years,
)
stub_template_stats = [
{
'template_type': 'sms',