Skip to content

Commit 9d5fcf9

Browse files
committed
Update .pre-commit-config.yaml file.
1 parent 849ad28 commit 9d5fcf9

File tree

7 files changed

+37
-24
lines changed

7 files changed

+37
-24
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: "v4.5.0"
3+
rev: "v5.0.0"
44
hooks:
55
- id: check-added-large-files
66
- id: check-case-conflict
@@ -15,31 +15,28 @@ repos:
1515
- id: requirements-txt-fixer
1616
- id: trailing-whitespace
1717
- repo: https://github.com/codespell-project/codespell
18-
rev: v2.2.6
18+
rev: v2.3.0
1919
hooks:
2020
- id: codespell
21+
args: ["--ignore-words-list=socio-economic"]
2122
exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst"
22-
- repo: https://github.com/ikamensh/flynt
23-
rev: "1.0.1"
24-
hooks:
25-
- id: flynt
26-
args: [--verbose]
2723
- repo: https://github.com/PyCQA/isort
2824
rev: "5.13.2"
2925
hooks:
3026
- id: isort
3127
- repo: https://github.com/astral-sh/ruff-pre-commit
32-
rev: "v0.1.14"
28+
rev: "v0.8.2"
3329
hooks:
3430
- id: ruff-format
3531
- id: ruff
32+
args: [--fix]
3633
- repo: https://github.com/adamchainz/blacken-docs
37-
rev: 1.16.0
34+
rev: 1.19.1
3835
hooks:
3936
- id: blacken-docs
4037
language_version: python3.10
4138
- repo: https://github.com/pre-commit/mirrors-prettier
42-
rev: "v3.1.0"
39+
rev: "v4.0.0-alpha.8"
4340
hooks:
4441
- id: prettier
4542
- repo: https://github.com/pre-commit/pygrep-hooks

colour_visuals/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109

110110
try:
111111
_version: str = (
112-
subprocess.check_output(
113-
["git", "describe"], # noqa: S603, S607
112+
subprocess.check_output( # noqa: S603
113+
["git", "describe"], # noqa: S607
114114
cwd=os.path.dirname(__file__),
115115
stderr=subprocess.STDOUT,
116116
)

colour_visuals/common.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ def as_contiguous_array(
121121
-------
122122
:class:`numpy.ndarray`
123123
Converted variable :math:`a`.
124+
125+
Examples
126+
--------
127+
>>> a = np.ones((2, 3), order="F")
128+
>>> a.flags
129+
C_CONTIGUOUS : False
130+
F_CONTIGUOUS : True
131+
OWNDATA : True
132+
WRITEABLE : True
133+
ALIGNED : True
134+
WRITEBACKIFCOPY : False
135+
<BLANKLINE>
136+
>>> as_contiguous_array(a).flags
137+
C_CONTIGUOUS : True
138+
F_CONTIGUOUS : False
139+
OWNDATA : True
140+
WRITEABLE : True
141+
ALIGNED : True
142+
WRITEBACKIFCOPY : False
143+
<BLANKLINE>
124144
"""
125145

126146
return np.ascontiguousarray(a.astype(dtype))

colour_visuals/diagrams.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,8 @@ def kwargs_visual_spectral_locus(self, value: dict):
710710

711711
self._kwargs_visual_spectral_locus = value
712712

713-
for key, value in self._kwargs_visual_spectral_locus.items():
714-
setattr(self._spectral_locus, key, value)
713+
for key, item in self._kwargs_visual_spectral_locus.items():
714+
setattr(self._spectral_locus, key, item)
715715

716716

717717
class MixinPropertyKwargsVisualChromaticityDiagram:
@@ -758,8 +758,8 @@ def kwargs_visual_chromaticity_diagram(self, value: dict):
758758

759759
self._kwargs_visual_chromaticity_diagram = value
760760

761-
for key, value in self._kwargs_visual_chromaticity_diagram.items():
762-
setattr(self._chromaticity_diagram, key, value)
761+
for key, item in self._kwargs_visual_chromaticity_diagram.items():
762+
setattr(self._chromaticity_diagram, key, item)
763763

764764

765765
class VisualChromaticityDiagramCIE1931(

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

12-
import colour_visuals as package # noqa: E402
12+
import colour_visuals as package
1313

1414
basename = re.sub("_(\\w)", lambda x: x.group(1).upper(), package.__name__.title())
1515

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,9 @@ build-backend = "hatchling.build"
9292
packages = [ "colour_visuals" ]
9393

9494
[tool.codespell]
95+
ignore-words-list = "socio-economic"
9596
skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst"
9697

97-
[tool.flynt]
98-
line_length=999
99-
10098
[tool.isort]
10199
ensure_newline_before_comments = true
102100
force_grid_wrap = 0

tasks.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def tests(ctx: Context):
185185
message_box('Running "Pytest"...')
186186
ctx.run(
187187
"pytest "
188-
"--doctest-modules "
188+
# "--doctest-modules "
189189
f"--ignore={PYTHON_PACKAGE_NAME}/examples "
190190
f"--cov={PYTHON_PACKAGE_NAME} "
191191
f"{PYTHON_PACKAGE_NAME}"
@@ -338,9 +338,7 @@ def virtualise(ctx: Context, tests: bool = True):
338338
ctx.run(f"mv {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION} {unique_name}")
339339
ctx.run(f"rm -rf {unique_name}/{PYTHON_PACKAGE_NAME}/resources")
340340
ctx.run(
341-
"ln -s ../../../{0}/resources {1}/{0}".format(
342-
PYTHON_PACKAGE_NAME, unique_name
343-
)
341+
f"ln -s ../../../{PYTHON_PACKAGE_NAME}/resources {unique_name}/{PYTHON_PACKAGE_NAME}" # noqa: E501
344342
)
345343

346344
with ctx.cd(unique_name):

0 commit comments

Comments
 (0)