From 83c011e4b95301212b5f0d08d57fc0e888ff9da9 Mon Sep 17 00:00:00 2001
From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
Date: Sun, 27 Oct 2024 14:20:39 -0400
Subject: [PATCH 1/2] Update ruff settings; update hooks
---
.pre-commit-config.yaml | 12 +++++++++---
README.md | 2 +-
logo.svg | 8 ++++----
pyproject.toml | 23 ++++++++++++++++-------
src/exif_stripper/__init__.py | 2 +-
tests/test_cli.py | 7 +++----
6 files changed, 34 insertions(+), 20 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index db83eae..920bf10 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.6.0
+ rev: v5.0.0
hooks:
- id: check-toml
- id: check-yaml
@@ -8,7 +8,7 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.5.7
+ rev: v0.7.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
@@ -20,8 +20,14 @@ repos:
- id: numpydoc-validation
exclude: (tests/|docs/).*
+ - repo: https://github.com/econchick/interrogate
+ rev: 1.7.0
+ hooks:
+ - id: interrogate
+ files: tests/.*
+
- repo: https://github.com/tox-dev/pyproject-fmt
- rev: 2.2.1
+ rev: v2.4.3
hooks:
- id: pyproject-fmt
args: [--keep-full-version, --no-print-diff]
diff --git a/README.md b/README.md
index a3c40d1..a406d94 100644
--- a/README.md
+++ b/README.md
@@ -42,7 +42,7 @@
-
+
diff --git a/logo.svg b/logo.svg
index a90ae48..ad61e66 100644
--- a/logo.svg
+++ b/logo.svg
@@ -1,10 +1,10 @@
\ No newline at end of file
+ EXIFstripper
diff --git a/pyproject.toml b/pyproject.toml
index 02c88c4..006302e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -63,19 +63,28 @@ version = { attr = "exif_stripper.__version__" }
line-length = 88
format.indent-style = "space"
format.quote-style = "single"
+format.docstring-code-format = true
lint.select = [
- "B", # flake8-bugbear rules
- "C", # mccabe rules
- "E", # pycodestyle error rules
- "F", # pyflakes rules
- "I", # isort rules
- "W", # pycodestyle warning rules
+ "ANN", # flake8-annotations
+ "B", # flake8-bugbear
+ "C4", # flake8-comprehensions
+ "E", # pycodestyle error
+ "ERA", # eradicate (commented out code)
+ "F", # pyflakes
+ "FA", # flake8-future-annotations
+ "I", # isort
+ "N", # pep8-naming
+ "PTH", # flake8-use-pathlib
+ "SIM", # flake8-simplify
+ "TRY", # tryceratops
+ "UP", # pyupgrade
+ "W", # pycodestyle warning
]
lint.ignore = [
- "C901", # max-complexity-10
"E501", # line-too-long
]
+lint.extend-per-file-ignores."tests/*" = [ "ANN" ] # don't require annotations for tests
lint.isort.known-first-party = [
"exif_stripper",
]
diff --git a/src/exif_stripper/__init__.py b/src/exif_stripper/__init__.py
index 5eb91e7..b7fcef5 100644
--- a/src/exif_stripper/__init__.py
+++ b/src/exif_stripper/__init__.py
@@ -7,7 +7,7 @@
from PIL import Image, UnidentifiedImageError
-__version__ = '0.4.0'
+__version__ = '0.5.0'
def process_image(filename: str | os.PathLike) -> bool:
diff --git a/tests/test_cli.py b/tests/test_cli.py
index d3b9459..77d212d 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -3,6 +3,7 @@
import platform
import subprocess
import sys
+from contextlib import suppress
from getpass import getuser
import pytest
@@ -33,16 +34,14 @@ def image_with_exif_data(tmp_path):
def image_with_metadata(image_with_exif_data):
"""Fixture for an image with metadata."""
if RUNNING_ON in ['Darwin', 'Linux']:
- try:
+ with suppress(OSError):
+ # OSError raised if filesystem does not support extended attributes
xattr(image_with_exif_data).set(
f'{getuser()}.test_extended_attribute'
if RUNNING_ON == 'Linux'
else 'com.apple.macl',
b'\x00',
)
- except OSError: # pragma: nocover
- # filesystem does not support extended attributes
- pass
return image_with_exif_data
From 81a033b083d1513786cdc51a74cad37495fcec48 Mon Sep 17 00:00:00 2001
From: Stefanie Molin <24376333+stefmolin@users.noreply.github.com>
Date: Sun, 27 Oct 2024 14:24:59 -0400
Subject: [PATCH 2/2] Update example
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a406d94..d18f154 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,7 @@ Add the following to your `.pre-commit-config.yaml` file:
```yaml
- repo: https://github.com/stefmolin/exif-stripper
- rev: 0.4.0
+ rev: 0.5.0
hooks:
- id: strip-exif
```