Skip to content

Commit 87a368b

Browse files
committed
Use *isort*.
1 parent 7c93394 commit 87a368b

8 files changed

+30
-18
lines changed

.pre-commit-config.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ repos:
33
rev: '1.0.1'
44
hooks:
55
- id: flynt
6+
- repo: https://github.com/PyCQA/isort
7+
rev: '5.12.0'
8+
hooks:
9+
- id: isort
610
- repo: https://github.com/charliermarsh/ruff-pre-commit
711
rev: 'v0.0.285'
812
hooks:

app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
===========
44
"""
55

6-
import dash
76
import os
7+
8+
import dash
89
from colour.hints import Optional
910
from flask import Flask
1011

11-
1212
__author__ = "Colour Developers"
1313
__copyright__ = "Copyright 2018 Colour Developers"
1414
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"

apps/common.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"""
55

66
from io import StringIO
7+
78
from colour.adaptation import CHROMATIC_ADAPTATION_TRANSFORMS
89
from colour.colorimetry import CCS_ILLUMINANTS
10+
from colour.hints import ArrayLike, Dict, Iterable, List
911
from colour.io import LUTOperatorMatrix, write_LUT_SonySPImtx
1012
from colour.models import RGB_COLOURSPACES
1113
from colour.utilities import as_float_array
1214

13-
from colour.hints import ArrayLike, Dict, Iterable, List
14-
1515
__author__ = "Colour Developers"
1616
__copyright__ = "Copyright 2018 Colour Developers"
1717
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"

apps/rgb_colourspace_chromatically_adapted_primaries.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import sys
77
import urllib.parse
88
from contextlib import suppress
9-
from dash.dcc import Dropdown, Link, Location, Markdown, Slider
10-
from dash.dependencies import Input, Output
11-
from dash.html import A, Button, Code, Div, H3, H5, Li, Pre, Ul
129
from urllib.parse import parse_qs, urlencode, urlparse
1310

1411
from colour.colorimetry import CCS_ILLUMINANTS
1512
from colour.models import RGB_COLOURSPACES, chromatically_adapted_primaries
1613
from colour.utilities import numpy_print_options
14+
from dash.dcc import Dropdown, Link, Location, Markdown, Slider
15+
from dash.dependencies import Input, Output
16+
from dash.html import H3, H5, A, Button, Code, Div, Li, Pre, Ul
1717

1818
from app import APP, SERVER_URL
1919
from apps.common import (

apps/rgb_colourspace_transformation_matrix.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
=================================================
44
"""
55

6-
import urllib.parse
76
import re
87
import sys
8+
import urllib.parse
99
from contextlib import suppress
10-
from dash.dcc import Dropdown, Location, Link, Markdown, Slider
11-
from dash.dependencies import Input, Output
12-
from dash.html import A, Button, Code, Div, H3, H5, Li, Pre, Ul
1310
from urllib.parse import parse_qs, urlencode, urlparse
1411

1512
from colour.models import RGB_COLOURSPACES, matrix_RGB_to_RGB
1613
from colour.utilities import numpy_print_options
14+
from dash.dcc import Dropdown, Link, Location, Markdown, Slider
15+
from dash.dependencies import Input, Output
16+
from dash.html import H3, H5, A, Button, Code, Div, Li, Pre, Ul
1717

1818
from app import APP, SERVER_URL
1919
from apps.common import (

index.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"""
55

66
import dash
7-
from dash.dependencies import Input, Output
87
from dash.dcc import Link, Location, Markdown
9-
from dash.html import A, Div, H3, P
8+
from dash.dependencies import Input, Output
9+
from dash.html import H3, A, Div, P
1010

11-
import apps.rgb_colourspace_transformation_matrix as app_1
1211
import apps.rgb_colourspace_chromatically_adapted_primaries as app_2
12+
import apps.rgb_colourspace_transformation_matrix as app_1
1313
from app import APP, SERVER # noqa: F401
1414

1515
__author__ = "Colour Developers"

pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ exclude = '''
7979
[tool.flynt]
8080
line_length=999
8181

82+
[tool.isort]
83+
ensure_newline_before_comments = true
84+
force_grid_wrap = 0
85+
include_trailing_comma = true
86+
line_length = 88
87+
multi_line_output = 3
88+
split_on_trailing_comma = true
89+
use_parentheses = true
90+
8291
[tool.pyright]
8392
reportMissingImports = false
8493
reportMissingModuleSource = false

tasks.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,19 @@
44
"""
55

66
import contextlib
7+
import inspect
78
import platform
8-
from invoke.exceptions import Failure
99

1010
from colour.utilities import message_box
11+
from invoke.exceptions import Failure
1112

1213
import app
1314

14-
import inspect
15-
1615
if not hasattr(inspect, "getargspec"):
1716
inspect.getargspec = inspect.getfullargspec # pyright: ignore
1817

19-
from invoke.tasks import task
2018
from invoke.context import Context
19+
from invoke.tasks import task
2120

2221
__author__ = "Colour Developers"
2322
__copyright__ = "Copyright 2018 Colour Developers"

0 commit comments

Comments
 (0)