pre-commit: Add config
This commit is contained in:
53
.pre-commit-config.yaml
Normal file
53
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
exclude_types: [svg]
|
||||
- id: file-contents-sorter
|
||||
files: po/LINGUAS|po/POTFILES\.in
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.14.10
|
||||
hooks:
|
||||
- id: ruff-check
|
||||
args: [--select, I, --fix] # Only fix unsorted imports automatically
|
||||
- id: ruff-check
|
||||
- id: ruff-format
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pyright
|
||||
name: pyright
|
||||
language: node
|
||||
additional_dependencies: [pyright]
|
||||
types_or: [python, pyi]
|
||||
entry: pyright
|
||||
|
||||
- id: blueprint-format # https://gitlab.gnome.org/GNOME/blueprint-compiler/-/merge_requests/258
|
||||
name: blueprint
|
||||
language: system
|
||||
files: \.blp$
|
||||
entry: blueprint-compiler format --fix --no-diff
|
||||
|
||||
- id: meson-format
|
||||
name: meson
|
||||
language: python
|
||||
files: meson\.build|meson\.options
|
||||
entry: meson format --inplace
|
||||
|
||||
- id: prettier
|
||||
name: prettier
|
||||
language: node
|
||||
additional_dependencies: [prettier]
|
||||
types_or: [css, json, yaml]
|
||||
entry: prettier --write
|
||||
|
||||
- id: svgo
|
||||
name: svgo
|
||||
language: node
|
||||
additional_dependencies: [svgo]
|
||||
types: [svg]
|
||||
entry: svgo
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import sys
|
||||
|
||||
from gi.events import GLibEventLoopPolicy
|
||||
from gi.events import GLibEventLoopPolicy # pyright: ignore[reportMissingImports]
|
||||
|
||||
from .application import Application
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ python.install_sources(
|
||||
'__init__.py',
|
||||
'__main__.py',
|
||||
'application.py',
|
||||
'games.py',
|
||||
'gamepads.py',
|
||||
'games.py',
|
||||
),
|
||||
subdir: 'cartridges',
|
||||
)
|
||||
|
||||
@@ -130,7 +130,15 @@ template $Window: Adw.ApplicationWindow {
|
||||
content: Adw.ToastOverlay toast_overlay {
|
||||
child: Adw.ViewStack {
|
||||
enable-transitions: true;
|
||||
visible-child-name: bind $_if_else(grid.model as <NoSelection>.n-items, "grid", $_if_else(template.search-text, "empty-search", $_if_else(template.show-hidden, "empty-hidden", "empty") as <string>) as <string>) as <string>;
|
||||
visible-child-name: bind $_if_else(
|
||||
grid.model as <NoSelection>.n-items,
|
||||
"grid",
|
||||
$_if_else(
|
||||
template.search-text,
|
||||
"empty-search",
|
||||
$_if_else(template.show-hidden, "empty-hidden", "empty") as <string>
|
||||
) as <string>
|
||||
) as <string>;
|
||||
|
||||
Adw.ViewStackPage {
|
||||
name: "grid";
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g fill="#222"><path d="M1.5 2h13a1.5 1.5 0 0 1 0 3h-13a1.5 1.5 0 0 1 0-3M4.5 7h7a1.5 1.5 0 0 1 0 3h-7a1.5 1.5 0 0 1 0-3M7.5 12h1a1.5 1.5 0 0 1 0 3h-1a1.5 1.5 0 0 1 0-3m0 0"/></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="#222" d="M1.5 2h13a1.5 1.5 0 0 1 0 3h-13a1.5 1.5 0 0 1 0-3m3 5h7a1.5 1.5 0 0 1 0 3h-7a1.5 1.5 0 0 1 0-3m3 5h1a1.5 1.5 0 0 1 0 3h-1a1.5 1.5 0 0 1 0-3m0 0"/></svg>
|
||||
|
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 256 B |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -6,8 +6,8 @@ cartridges/sources/steam.py
|
||||
cartridges/ui/cover.blp
|
||||
cartridges/ui/cover.py
|
||||
cartridges/ui/game-details.blp
|
||||
cartridges/ui/game_details.py
|
||||
cartridges/ui/game-item.blp
|
||||
cartridges/ui/game_details.py
|
||||
cartridges/ui/game_item.py
|
||||
cartridges/ui/shortcuts-dialog.blp
|
||||
cartridges/ui/window.blp
|
||||
|
||||
Reference in New Issue
Block a user