Skip to content

Commit

Permalink
Update .pre-commit-config.yaml file.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Dec 14, 2024
1 parent 849ad28 commit 9d5fcf9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 24 deletions.
17 changes: 7 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -15,31 +15,28 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args: ["--ignore-words-list=socio-economic"]
exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst"
- repo: https://github.com/ikamensh/flynt
rev: "1.0.1"
hooks:
- id: flynt
args: [--verbose]
- repo: https://github.com/PyCQA/isort
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.14"
rev: "v0.8.2"
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
rev: 1.19.1
hooks:
- id: blacken-docs
language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pygrep-hooks
Expand Down
4 changes: 2 additions & 2 deletions colour_visuals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@

try:
_version: str = (
subprocess.check_output(
["git", "describe"], # noqa: S603, S607
subprocess.check_output( # noqa: S603
["git", "describe"], # noqa: S607
cwd=os.path.dirname(__file__),
stderr=subprocess.STDOUT,
)
Expand Down
20 changes: 20 additions & 0 deletions colour_visuals/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,26 @@ def as_contiguous_array(
-------
:class:`numpy.ndarray`
Converted variable :math:`a`.
Examples
--------
>>> a = np.ones((2, 3), order="F")
>>> a.flags
C_CONTIGUOUS : False
F_CONTIGUOUS : True
OWNDATA : True
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
<BLANKLINE>
>>> as_contiguous_array(a).flags
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : True
WRITEABLE : True
ALIGNED : True
WRITEBACKIFCOPY : False
<BLANKLINE>
"""

return np.ascontiguousarray(a.astype(dtype))
Expand Down
8 changes: 4 additions & 4 deletions colour_visuals/diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ def kwargs_visual_spectral_locus(self, value: dict):

self._kwargs_visual_spectral_locus = value

for key, value in self._kwargs_visual_spectral_locus.items():
setattr(self._spectral_locus, key, value)
for key, item in self._kwargs_visual_spectral_locus.items():
setattr(self._spectral_locus, key, item)


class MixinPropertyKwargsVisualChromaticityDiagram:
Expand Down Expand Up @@ -758,8 +758,8 @@ def kwargs_visual_chromaticity_diagram(self, value: dict):

self._kwargs_visual_chromaticity_diagram = value

for key, value in self._kwargs_visual_chromaticity_diagram.items():
setattr(self._chromaticity_diagram, key, value)
for key, item in self._kwargs_visual_chromaticity_diagram.items():
setattr(self._chromaticity_diagram, key, item)


class VisualChromaticityDiagramCIE1931(
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

import colour_visuals as package # noqa: E402
import colour_visuals as package

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

Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ build-backend = "hatchling.build"
packages = [ "colour_visuals" ]

[tool.codespell]
ignore-words-list = "socio-economic"
skip = "BIBLIOGRAPHY.bib,CONTRIBUTORS.rst"

[tool.flynt]
line_length=999

[tool.isort]
ensure_newline_before_comments = true
force_grid_wrap = 0
Expand Down
6 changes: 2 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def tests(ctx: Context):
message_box('Running "Pytest"...')
ctx.run(
"pytest "
"--doctest-modules "
# "--doctest-modules "
f"--ignore={PYTHON_PACKAGE_NAME}/examples "
f"--cov={PYTHON_PACKAGE_NAME} "
f"{PYTHON_PACKAGE_NAME}"
Expand Down Expand Up @@ -338,9 +338,7 @@ def virtualise(ctx: Context, tests: bool = True):
ctx.run(f"mv {PYPI_ARCHIVE_NAME}-{APPLICATION_VERSION} {unique_name}")
ctx.run(f"rm -rf {unique_name}/{PYTHON_PACKAGE_NAME}/resources")
ctx.run(
"ln -s ../../../{0}/resources {1}/{0}".format(
PYTHON_PACKAGE_NAME, unique_name
)
f"ln -s ../../../{PYTHON_PACKAGE_NAME}/resources {unique_name}/{PYTHON_PACKAGE_NAME}" # noqa: E501
)

with ctx.cd(unique_name):
Expand Down

0 comments on commit 9d5fcf9

Please sign in to comment.