Skip to content

Commit 16fd474

Browse files
cclaussMichaIng
andauthored
pre-commit: Enable black --skip-string-normalization (#2351)
* pre-commit: Enable black --skip-string-normalization * pre-commit: Show diff on failure Signed-off-by: MichaIng <[email protected]> * Fix pre-commit failures Signed-off-by: MichaIng <[email protected]> Co-authored-by: MichaIng <[email protected]>
1 parent cacc879 commit 16fd474

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2745
-1301
lines changed

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
- run: pip install pre-commit
1919
- run: pre-commit --version
2020
- run: pre-commit install
21-
- run: pre-commit run --all-files
21+
- run: pre-commit run --all-files --show-diff-on-failure

.pre-commit-config.yaml

+5-11
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ repos:
1717
- id: bandit
1818
args:
1919
- --skip=B104,B105,B108,B110,B301,B310,B321,B324,B402,B403,B404,B602,B603,B604,B605,B607,B701
20-
#- repo: https://github.com/python/black
21-
# rev: 22.1.0
22-
# hooks:
23-
# - id: black
24-
# args:
25-
# - --skip-string-normalization
20+
- repo: https://github.com/python/black
21+
rev: 22.1.0
22+
hooks:
23+
- id: black
24+
args: [--skip-string-normalization]
2625
- repo: https://github.com/codespell-project/codespell
2726
rev: v2.1.0
2827
hooks:
@@ -46,11 +45,6 @@ repos:
4645
hooks:
4746
- id: isort
4847
args: ["--profile", "black", "--filter-files"]
49-
#- repo: https://github.com/pre-commit/mirrors-mypy
50-
# rev: v0.931
51-
# hooks:
52-
# - id: mypy
53-
# args: [--ignore-missing-imports, --install-types, --non-interactive]
5448
- repo: https://github.com/asottile/pyupgrade
5549
rev: v2.31.0
5650
hooks:

motioneye/cleanup.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def start():
3333

3434
# schedule the first call a bit later to improve performance at startup
3535
io_loop = IOLoop.instance()
36-
io_loop.add_timeout(datetime.timedelta(seconds=min(settings.CLEANUP_INTERVAL, 60)), _run_process)
36+
io_loop.add_timeout(
37+
datetime.timedelta(seconds=min(settings.CLEANUP_INTERVAL, 60)), _run_process
38+
)
3739

3840

3941
def stop():
@@ -63,7 +65,9 @@ def _run_process():
6365
io_loop = IOLoop.instance()
6466

6567
# schedule the next call
66-
io_loop.add_timeout(datetime.timedelta(seconds=settings.CLEANUP_INTERVAL), _run_process)
68+
io_loop.add_timeout(
69+
datetime.timedelta(seconds=settings.CLEANUP_INTERVAL), _run_process
70+
)
6771

6872
if not running(): # check that the previous process has finished
6973
logging.debug('running cleanup process...')
@@ -85,5 +89,4 @@ def _do_cleanup():
8589
logging.debug('cleanup done')
8690

8791
except Exception as e:
88-
logging.error('failed to cleanup media files: {msg}'.format(
89-
msg=str(e)), exc_info=True)
92+
logging.error(f'failed to cleanup media files: {str(e)}', exc_info=True)

0 commit comments

Comments
 (0)