mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
Perform GDScript format checks using pre-commit
This commit is contained in:
parent
8f08945df2
commit
aa2b93248e
4 changed files with 21 additions and 21 deletions
13
.github/workflows/main.yml
vendored
13
.github/workflows/main.yml
vendored
|
@ -320,16 +320,9 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
check-code-format:
|
||||
name: "Check Code Format"
|
||||
check-pre-commit:
|
||||
name: "Check Pre-Commit"
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.9
|
||||
cache: "pip"
|
||||
- name: Install python dependencies
|
||||
run: pip install -r requirements.txt
|
||||
- name: GDScript format check
|
||||
run: gdformat -c .
|
||||
- uses: pre-commit/action@v3.0.1
|
||||
|
|
|
@ -13,3 +13,8 @@ repos:
|
|||
rev: v3.1.0
|
||||
hooks:
|
||||
- id: prettier
|
||||
- repo: https://github.com/Scony/godot-gdscript-toolkit
|
||||
rev: 4.2.2
|
||||
hooks:
|
||||
- id: gdformat
|
||||
exclude: "^addons/gut/"
|
||||
|
|
|
@ -24,7 +24,7 @@ enum SelectionMode {
|
|||
POINTER,
|
||||
}
|
||||
|
||||
@export var update_mode: UpdateMode = UpdateMode.AUTO :
|
||||
@export var update_mode: UpdateMode = UpdateMode.AUTO:
|
||||
get:
|
||||
return update_mode # TODOConverter40 Non existent get function
|
||||
set(p_update_mode):
|
||||
|
@ -113,9 +113,9 @@ func _ready():
|
|||
_update_theme()
|
||||
|
||||
_native_terminal.update_mode = update_mode
|
||||
_native_terminal.connect("data_sent",Callable(self,"_on_data_sent"))
|
||||
_native_terminal.connect("key_pressed",Callable(self,"_on_key_pressed"))
|
||||
_native_terminal.connect("size_changed",Callable(self,"_on_size_changed"))
|
||||
_native_terminal.connect("data_sent", Callable(self, "_on_data_sent"))
|
||||
_native_terminal.connect("key_pressed", Callable(self, "_on_key_pressed"))
|
||||
_native_terminal.connect("size_changed", Callable(self, "_on_size_changed"))
|
||||
|
||||
_viewport.size = size
|
||||
_viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
|
||||
|
@ -123,12 +123,12 @@ func _ready():
|
|||
_screen.set_anchors_preset(PRESET_VCENTER_WIDE)
|
||||
_screen.texture = _viewport.get_texture()
|
||||
|
||||
_native_terminal.connect("bell",Callable(self,"_on_bell"))
|
||||
_native_terminal.connect("bell", Callable(self, "_on_bell"))
|
||||
_bell_timer.one_shot = true
|
||||
add_child(_bell_timer)
|
||||
|
||||
_selection_timer.wait_time = 0.05
|
||||
_selection_timer.connect("timeout",Callable(self,"_on_selection_held"))
|
||||
_selection_timer.connect("timeout", Callable(self, "_on_selection_held"))
|
||||
|
||||
add_child(_viewport)
|
||||
add_child(_screen)
|
||||
|
@ -140,7 +140,7 @@ func _ready():
|
|||
# we make all the draw_* calls caused by writing. We need to use signals
|
||||
# here rather than yield otherwise we will sometimes get a "Resumed
|
||||
# function after yield but class instance is gone" error.
|
||||
RenderingServer.connect("frame_pre_draw",Callable(self,"_flush"))
|
||||
RenderingServer.connect("frame_pre_draw", Callable(self, "_flush"))
|
||||
|
||||
|
||||
func _update_theme():
|
||||
|
@ -243,7 +243,10 @@ func _handle_selection(event: InputEventMouse):
|
|||
|
||||
|
||||
func _on_selection_held() -> void:
|
||||
if not Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) or _selecting_mode == SelectionMode.NONE:
|
||||
if (
|
||||
not Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT)
|
||||
or _selecting_mode == SelectionMode.NONE
|
||||
):
|
||||
if copy_on_selection:
|
||||
var selection = _native_terminal.copy_selection()
|
||||
# TODO:godot4
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
gdtoolkit==4.2.2
|
Loading…
Reference in a new issue