Skip to content

Commit

Permalink
add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdcs committed Oct 20, 2023
1 parent 15c66b5 commit e920349
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ repos:
rev: '1.0.1'
hooks:
- id: flynt
- repo: https://github.com/PyCQA/isort
rev: '5.12.0'
hooks:
- id: isort
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.285'
hooks:
Expand All @@ -16,4 +20,4 @@ repos:
rev: v0.3.8
hooks:
- id: blackdoc
language_version: python3.9
language_version: python3.9
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@

import os
import re
import setuptools.archive_util
import sys
import urllib.parse
import urllib.request
from pathlib import Path

import setuptools.archive_util

sys.path.append(str(Path(__file__).parent.parent))

import colour as package # noqa: E402
Expand Down
8 changes: 4 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@

from __future__ import annotations

import biblib.bib
import contextlib
import fnmatch
import inspect
import os
import re
import uuid

import biblib.bib

import colour
from colour.utilities import message_box

import inspect

if not hasattr(inspect, "getargspec"):
inspect.getargspec = inspect.getfullargspec # pyright: ignore

from invoke.tasks import task
from invoke.context import Context
from invoke.tasks import task

__author__ = "Colour Developers"
__copyright__ = "Copyright 2013 Colour Developers"
Expand Down
28 changes: 15 additions & 13 deletions utilities/generate_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@

mpl.use("AGG")

import os # noqa: E402

import matplotlib.pyplot as plt # noqa: E402
import numpy as np # noqa: E402
import os # noqa: E402
import trimesh # noqa: E402

import colour # noqa: E402
from colour.characterisation import SDS_COLOURCHECKERS # noqa: E402
from colour.colorimetry import ( # noqa: E402
MSDS_CMFS_STANDARD_OBSERVER,
SDS_ILLUMINANTS,
SDS_LIGHT_SOURCES,
SDS_LEFS_PHOTOPIC,
SDS_LEFS_SCOTOPIC,
MSDS_CMFS_STANDARD_OBSERVER,
SDS_LIGHT_SOURCES,
SpectralDistribution,
SpectralShape,
sd_blackbody,
Expand All @@ -34,13 +36,13 @@
from colour.models import ( # noqa: E402
RGB_COLOURSPACE_sRGB,
RGB_to_XYZ,
sRGB_to_XYZ,
XYZ_to_sRGB,
XYZ_to_xy,
sRGB_to_XYZ,
)
from colour.plotting import ( # noqa: E402
colour_style,
ColourSwatch,
colour_style,
plot_automatic_colour_conversion_graph,
plot_blackbody_colours,
plot_blackbody_spectral_radiance,
Expand All @@ -63,9 +65,9 @@
plot_multi_lightness_functions,
plot_multi_luminance_functions,
plot_multi_munsell_value_functions,
plot_multi_sds,
plot_multi_sds_colour_quality_scales_bars,
plot_multi_sds_colour_rendering_indexes_bars,
plot_multi_sds,
plot_planckian_locus_in_chromaticity_diagram_CIE1931,
plot_planckian_locus_in_chromaticity_diagram_CIE1960UCS,
plot_planckian_locus_in_chromaticity_diagram_CIE1976UCS,
Expand All @@ -91,26 +93,26 @@
plot_single_lightness_function,
plot_single_luminance_function,
plot_single_munsell_value_function,
plot_single_sd,
plot_single_sd_colour_quality_scale_bars,
plot_single_sd_colour_rendering_index_bars,
plot_single_sd_colour_rendition_report,
plot_single_sd_rayleigh_scattering,
plot_single_sd,
plot_the_blue_sky,
plot_visible_spectrum,
plot_visible_spectrum_section,
render,
)
from colour.plotting.diagrams import ( # noqa: E402
plot_spectral_locus,
plot_chromaticity_diagram_colours,
plot_chromaticity_diagram,
plot_chromaticity_diagram_colours,
plot_sds_in_chromaticity_diagram,
plot_spectral_locus,
)
from colour.plotting.models import ( # noqa: E402
plot_RGB_colourspaces_in_chromaticity_diagram,
plot_RGB_chromaticities_in_chromaticity_diagram,
plot_ellipses_MacAdam1942_in_chromaticity_diagram,
plot_RGB_chromaticities_in_chromaticity_diagram,
plot_RGB_colourspaces_in_chromaticity_diagram,
)
from colour.plotting.quality import plot_colour_quality_bars # noqa: E402
from colour.plotting.section import ( # noqa: E402
Expand All @@ -123,10 +125,10 @@
plot_planckian_locus_in_chromaticity_diagram,
)
from colour.quality import colour_quality_scale # noqa: E402
from colour.utilities import ( # noqa: E402
from colour.utilities import ( # noqa: E402; noqa: RUF100
domain_range_scale,
filter_warnings,
) # noqa: RUF100
)

__copyright__ = "Copyright 2013 Colour Developers"
__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"
Expand Down
3 changes: 1 addition & 2 deletions utilities/literalise.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

import os
import re
from textwrap import dedent

import sys
from textwrap import dedent

sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))

Expand Down
1 change: 0 additions & 1 deletion utilities/mock_for_colour.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"""

import os

from types import FunctionType, MethodType, ModuleType

__author__ = "Sphinx Team, Colour Developers"
Expand Down

0 comments on commit e920349

Please sign in to comment.