diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3d309f84 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + # Workaround for https://github.com/adamchainz/pre-commit-dprint/issues/4 + - id: pretty-format-json + exclude: ".vscode/.*|dprint.json" # Exclude jsonc + args: [--autofix, --no-sort-keys] + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + - id: mixed-line-ending + args: [--fix=crlf] + - id: check-case-conflict + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.8.0 + hooks: + - id: pretty-format-ini + args: [--autofix] + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "v0.0.262" # Must match requirements-dev.txt + hooks: + - id: ruff + args: [--fix] + - repo: https://github.com/pre-commit/mirrors-autopep8 + rev: "v2.0.2" # Must match requirements-dev.txt + hooks: + - id: autopep8 + - repo: https://github.com/asottile/add-trailing-comma + rev: v2.4.0 # Must match requirements-dev.txt + hooks: + - id: add-trailing-comma diff --git a/README.md b/README.md index 8a62ba64..babdf7f6 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ If this option is disabled, when the reset hotkey is hit, the reset button is pr - `002_SplitName_(0.9)_[10]_{d}.png` is the second split image with a threshold of 0.9, pause time of 10, and is a dummy split. - `003_SplitName_(0.85)_[20]_#3500#.png` is the third split image with a threshold of 0.85, pause time of 20 and has a delay split time of 3.5 seconds. - `004_SplitName_(0.9)_[10]_#3500#_@3@_{b}.png` is the fourth split image with a threshold of 0.9, pause time of 10 seconds, delay split time of 3.5 seconds, will loop 3 times, and will split when similarity is below the threshold rather than above. - + ## Special images ### How to Create a Masked Image diff --git a/mypy.ini b/mypy.ini index 27f9c438..a49a7797 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,21 +1,21 @@ ; We don't run mypy in the CI. This is just to help anyone who would like to use it manually. ; Namely, the mypy_primer tool. [mypy] -strict=true +strict = true ; Implicit return types ! -disallow_untyped_calls=false -disallow_untyped_defs=false -disallow_incomplete_defs=false +disallow_untyped_calls = false +disallow_untyped_defs = false +disallow_incomplete_defs = false ; Of course my stubs are going to be incomplete. Otherwise they'd be on typeshed! ; Mypy becomes really whack with its errors inside these stubs though -mypy_path=typings,src +mypy_path = typings,src ; exclude doesn't work with strict=true Why? -exclude=.*(typings|gen)/.* +exclude = .*(typings|gen)/.* [mypy-gen.*,cv2.*,] ; strict=false ; Doesn't work in overrides -follow_imports=skip -implicit_reexport=true -strict_optional=false -disable_error_code=attr-defined, misc, name-defined +follow_imports = skip +implicit_reexport = true +strict_optional = false +disable_error_code = attr-defined, misc, name-defined