Skip to content

Commit

Permalink
Add basic pre-commit config.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudep committed Aug 7, 2022
1 parent 74a9e90 commit f88dc87
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 5.0.2
hooks:
- id: flake8
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ universal = 0

[flake8]
# D105 - Missing docstring in magic method `__func__`
ignore = D105
ignore = D105,W503
max-line-length = 100
exclude = .git,
.tox,
docs/,
docs/*,
*/migrations/*,
tests/settings/
tests/settings/*,
sorl/thumbnail/__init__.py,
sorl/thumbnail/admin/__init__.py

Expand Down
5 changes: 4 additions & 1 deletion tests/thumbnail_tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
class AdminImageWidgetTests(SimpleTestCase):
def test_render_renderer_argument(self):
w = AdminImageWidget()
self.assertHTMLEqual(w.render('name', 'value', renderer=None), '<input type="file" name="name">')
self.assertHTMLEqual(
w.render('name', 'value', renderer=None),
'<input type="file" name="name">'
)
6 changes: 4 additions & 2 deletions tests/thumbnail_tests/test_templatetags.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ def epsilon(x, y):
exif = im._getexif()

# no exif editor in GraphicsMagick
if exif and not (settings.THUMBNAIL_CONVERT.endswith('gm convert') or
'pgmagick_engine' in settings.THUMBNAIL_ENGINE):
if exif and not (
settings.THUMBNAIL_CONVERT.endswith('gm convert')
or 'pgmagick_engine' in settings.THUMBNAIL_ENGINE
):
self.assertEqual(exif.get(0x0112), 1)


Expand Down

0 comments on commit f88dc87

Please sign in to comment.