Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [main, master, develop, dev]
branches: [main, dev*]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop, dev]
branches: [dev*]
schedule:
- cron: "26 13 * * 6"

Expand All @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
5 changes: 2 additions & 3 deletions .github/workflows/lint-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
push:
branches:
- main
- master
- dev*
paths:
- "**.py"
Expand All @@ -21,7 +20,6 @@ on:
pull_request:
branches:
- main
- master
- dev*
paths:
- "**.py"
Expand Down Expand Up @@ -51,9 +49,10 @@ jobs:
echo $Env:RUFF_VERSION
echo "RUFF_VERSION=$Env:RUFF_VERSION" >> $Env:GITHUB_OUTPUT
shell: pwsh
- uses: astral-sh/ruff-action@v2
- uses: astral-sh/ruff-action@v3
with:
version: ${{ steps.ruff_version.outputs.RUFF_VERSION }}
- run: ruff format --check
Pyright:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/printenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
type: boolean
push:
branches:
- master
- main
- dev

env:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: pretty-format-ini
args: [--autofix]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0 # Must match requirements-dev.txt
rev: v0.8.5 # Must match requirements-dev.txt
hooks:
- id: ruff
args: [--fix]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Easy to use image comparison based auto splitter for speedrunning on console or
This program can be used to automatically start, split, and reset your preferred speedrun timer by comparing images to a capture region. This allows you to focus more on your speedrun and less on managing your timer. It also improves the accuracy of your splits. It can be used in tandem with any speedrun timer that accepts hotkeys (LiveSplit, WSplit, etc.), and can be integrated with LiveSplit.

<p align="center">
<img src="/docs/2.2.2.gif" alt="Example" />
![Example](/docs/2.2.2.gif)
</p>

## Tutorial
Expand Down
2 changes: 1 addition & 1 deletion scripts/compile_resources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Write-Host 'Generated code from .ui files'

$build_vars_path = "$PSScriptRoot/../src/gen/build_vars.py"
If ($Env:GITHUB_EXCLUDE_BUILD_NUMBER -eq $true -or (
$Env:GITHUB_EVENT_NAME -eq 'push' -and $Env:GITHUB_REF_NAME -eq 'master')
$Env:GITHUB_EVENT_NAME -eq 'push' -and $Env:GITHUB_REF_NAME -eq 'main')
) {
$BUILD_NUMBER = ''
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/lint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ $originalDirectory = $pwd
Set-Location "$PSScriptRoot/.."
$exitCodes = 0

Write-Host "`nRunning formatting..."
ruff format

Write-Host "`nRunning Ruff ..."
ruff check --fix
$exitCodes += $LastExitCode
Expand All @@ -15,6 +12,9 @@ else {
Write-Host "`Ruff passed" -ForegroundColor Green
}

Write-Host "`nRunning formatting..."
ruff format

$pyrightVersion = 'latest' # Change this if latest has issues
Write-Host "`nRunning Pyright $pyrightVersion ..."
$Env:PYRIGHT_PYTHON_FORCE_VERSION = $pyrightVersion
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-r requirements.txt
#
# Linters & Formatters
ruff>=0.8.0
ruff>=0.8.5
#
# Types
scipy-stubs>=1.14.1.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ psutil>=6.0.0 # Python 3.13 support
# PyAutoGUI # See install.ps1
PyWinCtl>=0.0.42 # py.typed
# When needed, dev builds can be found at https://download.qt.io/snapshots/ci/pyside/dev?C=M;O=D
PySide6-Essentials<6.8.1 # Has typing issue with QMessageBox.warning https://bugreports.qt.io/browse/PYSIDE-2939
PySide6-Essentials>=6.8.2 # Fixed typing issue with QMessageBox.warning
scipy>=1.14.1 # Python 3.13 support
tomli-w>=1.1.0 # Typing fixes
typing-extensions>=4.4.0 # @override decorator support
Expand Down
2 changes: 1 addition & 1 deletion src/AutoSplit.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def __auto_splitter(self): # noqa: C901,PLR0912,PLR0915
while self.split_image_number < number_of_split_images:
# Check if we are not waiting for the split delay to send the key press
if self.waiting_for_split_delay:
time_millis = int(round(time() * ONE_SECOND))
time_millis = round(time() * ONE_SECOND)
if time_millis < split_time:
QApplication.processEvents()
continue
Expand Down
4 changes: 2 additions & 2 deletions src/d3d11.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def query_interface(self, iid: uuid.UUID | str) -> "IUnknown":
iid = uuid.UUID(iid)

ppv = wintypes.LPVOID()
_iid = GUID.from_buffer_copy(iid.bytes_le)
ret = self.QueryInterface(self, ctypes.byref(_iid), ctypes.byref(ppv))
riid = GUID.from_buffer_copy(iid.bytes_le)
ret = self.QueryInterface(self, ctypes.byref(riid), ctypes.byref(ppv))

if ret:
raise ctypes.WinError(ret)
Expand Down
2 changes: 1 addition & 1 deletion src/hotkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def send_command(autosplit: "AutoSplit", command: CommandStr):
_send_hotkey(autosplit.settings_dict["skip_split_hotkey"])
case "undo":
_send_hotkey(autosplit.settings_dict["undo_split_hotkey"])
case _: # pyright: ignore[reportUnnecessaryComparison]
case _:
raise KeyError(f"{command!r} is not a valid command")


Expand Down
10 changes: 5 additions & 5 deletions src/menu_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def open_update_checker(autosplit: "AutoSplit", latest_version: str, *, check_on


def view_help():
webbrowser.open(f"https://github.com/{GITHUB_REPOSITORY}/blob/master/docs/tutorial.md")
webbrowser.open(f"https://github.com/{GITHUB_REPOSITORY}/blob/main/docs/tutorial.md")


class __CheckForUpdatesThread(QtCore.QThread): # noqa: N801 # Private class
Expand Down Expand Up @@ -354,17 +354,17 @@ def __setup_bindings(self):
)

# Debug screenshot selection checkboxes initial values and bindings
_screenshot_on_setting = self._autosplit_ref.settings_dict["screenshot_on"]
screenshot_on_setting = self._autosplit_ref.settings_dict["screenshot_on"]
for command in _DEBUG_SCREENSHOT_COMMANDS:
checkbox: QtWidgets.QCheckBox = getattr(self, f"screenshot_on_{command}_checkbox")

checkbox.setChecked(command in _screenshot_on_setting)
checkbox.setChecked(command in screenshot_on_setting)

def add_or_del(checked: Literal[0, 2], command: CommandStr = command):
if checked:
_screenshot_on_setting.append(command)
screenshot_on_setting.append(command)
else:
_screenshot_on_setting.remove(command)
screenshot_on_setting.remove(command)

checkbox.stateChanged.connect(add_or_del)

Expand Down
2 changes: 1 addition & 1 deletion src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,5 +314,5 @@ def run_tesseract(png: bytes):

# Shared strings
# Check `excludeBuildNumber` during workflow dispatch build generate a clean version number
AUTOSPLIT_VERSION = "2.2.2" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
AUTOSPLIT_VERSION = "2.3" + (f"-{AUTOSPLIT_BUILD_NUMBER}" if AUTOSPLIT_BUILD_NUMBER else "")
GITHUB_REPOSITORY = AUTOSPLIT_GITHUB_REPOSITORY