Update pre-commit config & run pre-commit (#56)

This commit is contained in:
thomas
2023-05-28 18:33:58 +01:00
committed by GitHub
parent b03cce2050
commit c3193a5dbc
8 changed files with 37 additions and 14 deletions

View File

@@ -1,25 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- id: mixed-line-ending
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-quotes
- flake8-comprehensions
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
- id: double-quote-string-fixer
- id: name-tests-test
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--py37-plus, --add-import, "from __future__ import annotations"]
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
- id: add-trailing-comma
args: [--py36-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.2
hooks:
- id: autopep8
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
args:
- --max-line-length=120

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from abc import ABC
from abc import abstractmethod
from functools import partial
@@ -125,7 +127,7 @@ class PredefinedAspectRatioButtons(ArhUIComponent):
elem_classes='arh-btn-row',
):
for ar_str in aspect_ratios:
w, h, *_ = [abs(float(d)) for d in ar_str.split(':')]
w, h, *_ = (abs(float(d)) for d in ar_str.split(':'))
inputs = []
if use_max_dim_op:

View File

@@ -1,3 +1,4 @@
from __future__ import annotations
EXTENSION_NAME = 'Aspect Ratio Helper'
MAX_DIMENSION = 2048

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
import itertools
import gradio as gr

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
import contextlib
import aspect_ratio_helper._constants as _const

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
import gradio as gr
from modules import script_callbacks
from modules import scripts

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from aspect_ratio_helper.main import AspectRatioStepScript
__all__ = ['AspectRatioStepScript']

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
import pytest
import aspect_ratio_helper._constants as _constants