Skip to content

Commit

Permalink
Apply evenBetterToml
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jun 23, 2023
1 parent c7445b5 commit 5b02752
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 19 deletions.
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Keep in alphabetical order
{
"recommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"eamodio.gitlens",
"emeraldwalk.runonsave",
Expand All @@ -13,11 +12,14 @@
"pkief.material-icon-theme",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"tamasfe.even-better-toml",
],
"unwantedRecommendations": [
// Must disable in this workspace //
// https://github.com/microsoft/vscode/issues/40239 //
//
// even-better-toml has format on save
"bungcip.better-toml",
// VSCode has implemented an optimized version
"coenraads.bracket-pair-colorizer",
"coenraads.bracket-pair-colorizer-2",
Expand Down
22 changes: 21 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,25 @@
"xd:pre",
// Custom
"string"
]
],
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"evenBetterToml.formatter.alignComments": false,
"evenBetterToml.formatter.alignEntries": false,
"evenBetterToml.formatter.allowedBlankLines": 1,
"evenBetterToml.formatter.arrayAutoCollapse": true,
"evenBetterToml.formatter.arrayAutoExpand": true,
"evenBetterToml.formatter.arrayTrailingComma": true,
"evenBetterToml.formatter.columnWidth": 80,
"evenBetterToml.formatter.compactArrays": true,
"evenBetterToml.formatter.compactEntries": false,
"evenBetterToml.formatter.compactInlineTables": false,
"evenBetterToml.formatter.indentEntries": false,
"evenBetterToml.formatter.indentTables": false,
"evenBetterToml.formatter.inlineTableExpand": false,
"evenBetterToml.formatter.reorderArrays": true,
"evenBetterToml.formatter.trailingNewline": true,
// We like keeping TOML keys in a certain non-alphabetical order that feels more natural
"evenBetterToml.formatter.reorderKeys": false
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ The best way to create a masked image is to set your capture region as the entir

### Reset image

You can have one (and only one) image with the keyword `reset` in its name. AutoSplit will press the reset button when it finds this image. This image will only be used for resets and it will not be tied to any split. You can set a probability and pause time for it. The pause time is the amount of seconds AutoSplit will wait before checking for the reset image once the run starts. For example: `Reset_(0.95)_[10].png`.
You can have one (and only one) image with the keyword `reset` in its name. AutoSplit will press the reset button when it finds this image. This image will only be used for resets and it will not be tied to any split. You can set a threshold and pause time for it. The pause time is the amount of seconds AutoSplit will wait before checking for the reset image once the run starts. For example: `Reset_(0.95)_[10].png`.

### Start image

Expand Down
28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ignore = [
###
# Not needed or wanted
###
"D1", # pydocstyle Missing doctring
"D401", # pydocstyle: non-imperative-mood
"EM", # flake8-errmsg
"FBT", # flake8-boolean-trap
"INP", # flake8-no-pep420
"D1", # pydocstyle Missing doctring
"D401", # pydocstyle: non-imperative-mood
"EM", # flake8-errmsg
"FBT", # flake8-boolean-trap
"INP", # flake8-no-pep420
"ISC003", # flake8-implicit-str-concat: explicit-string-concatenation
# Short messages are still considered "long" messages
"TRY003", # tryceratops : raise-vanilla-args
Expand Down Expand Up @@ -47,8 +47,8 @@ ignore = [
# We have some Pascal case module names
"N999", # pep8-naming: Invalid module name
# Print are used as debug logs
"T20", # flake8-print
"D205", # Not all docstrings have a short description + desrciption
"T20", # flake8-print
# This is a relatively small, low contributors project. Git blame suffice.
"TD002",

Expand All @@ -63,11 +63,11 @@ ignore = [
"F811", # Re-exports false positives
"F821", # https://github.com/charliermarsh/ruff/issues/3011
# The following can't be controlled for external libraries:
"ICN001", # unconventional-import-alias
"N8", # Naming conventions
"A", # Shadowing builtin names
"A", # Shadowing builtin names
"ICN001", # unconventional-import-alias
"N8", # Naming conventions
"PLR0913", # Argument count
"PYI042", # CamelCase TypeAlias
"PYI042", # CamelCase TypeAlias
]

# https://beta.ruff.rs/docs/settings/#flake8-implicit-str-concat
Expand All @@ -83,14 +83,14 @@ required-imports = ["from __future__ import annotations"]
# https://github.com/charliermarsh/ruff/issues/2419
# https://github.com/charliermarsh/ruff/issues/3115
known-local-folder = [
"capture_method",
"gen",
"AutoControlledThread",
"AutoSplit",
"AutoSplitImage",
"capture_method",
"compare",
"error_messages",
"error_messages",
"gen",
"hotkeys",
"menu_bar",
"region_selection",
Expand Down Expand Up @@ -119,7 +119,7 @@ max_line_length = 120
aggressive = 3
ignore = [
"E124", # Closing bracket may not match multi-line method invocation style (enforced by add-trailing-comma)
"E70", # Allow ... on same line as def
"E70", # Allow ... on same line as def
]

# https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file
Expand All @@ -131,7 +131,7 @@ enableTypeIgnoreComments = false
reportImplicitOverride = "error"
reportImplicitStringConcatenation = "error"
reportCallInDefaultInitializer = "error"
reportMissingSuperCall = "none" # False positives on base classes
reportMissingSuperCall = "none" # False positives on base classes
reportPropertyTypeMismatch = "error"
reportUninitializedInstanceVariable = "error"
reportUnnecessaryTypeIgnoreComment = "error"
Expand Down
4 changes: 2 additions & 2 deletions src/capture_method/VideoCaptureDeviceCaptureMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cv2
import cv2.Error
import numpy as np
from pygrabber import dshow_graph
from pygrabber.dshow_graph import FilterGraph
from typing_extensions import override

from capture_method.CaptureMethodBase import CaptureMethodBase
Expand Down Expand Up @@ -89,7 +89,7 @@ def __read_loop(self, autosplit: AutoSplit):

def __init__(self, autosplit: AutoSplit):
super().__init__(autosplit)
filter_graph = dshow_graph.FilterGraph()
filter_graph = FilterGraph()
filter_graph.add_video_input_device(autosplit.settings_dict["capture_device_id"])
width, height = filter_graph.get_input_device().get_current_format()
filter_graph.remove_filters()
Expand Down

0 comments on commit 5b02752

Please sign in to comment.