Skip to content

Commit 45839c8

Browse files
committed
chore: fixed linter findings
Signed-off-by: aserowy <[email protected]>
1 parent 061fa57 commit 45839c8

File tree

4 files changed

+77
-64
lines changed

4 files changed

+77
-64
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ jobs:
1010
name: checks
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: read
15+
packages: read
16+
# To report GitHub Actions status checks
17+
statuses: write
18+
1319
steps:
1420
- name: checkout
1521
uses: actions/checkout@v4

.github/workflows/test.yaml

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,38 @@ jobs:
1010
name: tests
1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: read
15+
packages: read
16+
# To report GitHub Actions status checks
17+
statuses: write
18+
1319
steps:
14-
- name: checkout
15-
uses: actions/checkout@v4
16-
17-
- name: setup ‘lua’
18-
uses: leafo/[email protected]
19-
with:
20-
luaVersion: "5.1"
21-
22-
- name: setup ‘luarocks’
23-
uses: leafo/gh-actions-luarocks@v4
24-
25-
- name: setup dependencies
26-
run: |
27-
luarocks install busted
28-
luarocks install luacov-coveralls
29-
30-
- name: run
31-
run: busted -c -v
32-
env:
33-
LUA_PATH: "/home/runner/work/tmux.nvim/tmux.nvim/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?.lua;"
34-
35-
- name: report
36-
if: success()
37-
continue-on-error: true
38-
run: luacov-coveralls -i tmux.nvim/lua -e .luarocks
39-
env:
40-
COVERALLS_REPO_TOKEN: ${{ github.token }}
41-
LUA_PATH: "/home/runner/work/tmux.nvim/tmux.nvim/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?.lua;"
20+
- name: checkout
21+
uses: actions/checkout@v4
22+
23+
- name: setup ‘lua’
24+
uses: leafo/[email protected]
25+
with:
26+
luaVersion: "5.1"
27+
28+
- name: setup ‘luarocks’
29+
uses: leafo/gh-actions-luarocks@v4
30+
31+
- name: setup dependencies
32+
run: |
33+
luarocks install busted
34+
luarocks install luacov-coveralls
35+
36+
- name: run
37+
run: busted -c -v
38+
env:
39+
LUA_PATH: "/home/runner/work/tmux.nvim/tmux.nvim/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?.lua;"
40+
41+
- name: report
42+
if: success()
43+
continue-on-error: true
44+
run: luacov-coveralls -i tmux.nvim/lua -e .luarocks
45+
env:
46+
COVERALLS_REPO_TOKEN: ${{ github.token }}
47+
LUA_PATH: "/home/runner/work/tmux.nvim/tmux.nvim/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/lua/?.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?/init.lua;/home/runner/work/tmux.nvim/tmux.nvim/spec/?.lua;"

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
nodePackages.dockerfile-language-server-nodejs
2727
nodePackages.markdownlint-cli
2828
nodePackages.prettier
29+
shfmt
2930
stylua
3031
sumneko-lua-language-server
3132
];

tmux.nvim.tmux

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22

33
get_tmux_option() {
4-
local option=$1
5-
local default_value=$2
6-
local option_value
7-
option_value=$(tmux show-option -gqv "$option")
8-
if [ -z "$option_value" ]; then
9-
echo "$default_value"
10-
else
11-
echo "$option_value"
12-
fi
4+
local option=$1
5+
local default_value=$2
6+
local option_value
7+
option_value=$(tmux show-option -gqv "$option")
8+
if [ -z "$option_value" ]; then
9+
echo "$default_value"
10+
else
11+
echo "$option_value"
12+
fi
1313
}
1414

1515
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'"
@@ -25,27 +25,27 @@ navigation_kb_up=$(get_tmux_option "@tmux-nvim-navigation-keybinding-up" 'C-k')
2525
navigation_kb_right=$(get_tmux_option "@tmux-nvim-navigation-keybinding-right" 'C-l')
2626

2727
if $navigation_enabled; then
28-
if $navigation_cycle; then
29-
tmux bind-key -n "$navigation_kb_left" if-shell "$is_vim" "send-keys $navigation_kb_left" 'select-pane -L'
30-
tmux bind-key -n "$navigation_kb_down" if-shell "$is_vim" "send-keys $navigation_kb_down" 'select-pane -D'
31-
tmux bind-key -n "$navigation_kb_up" if-shell "$is_vim" "send-keys $navigation_kb_up" 'select-pane -U'
32-
tmux bind-key -n "$navigation_kb_right" if-shell "$is_vim" "send-keys $navigation_kb_right" 'select-pane -R'
28+
if $navigation_cycle; then
29+
tmux bind-key -n "$navigation_kb_left" if-shell "$is_vim" "send-keys $navigation_kb_left" 'select-pane -L'
30+
tmux bind-key -n "$navigation_kb_down" if-shell "$is_vim" "send-keys $navigation_kb_down" 'select-pane -D'
31+
tmux bind-key -n "$navigation_kb_up" if-shell "$is_vim" "send-keys $navigation_kb_up" 'select-pane -U'
32+
tmux bind-key -n "$navigation_kb_right" if-shell "$is_vim" "send-keys $navigation_kb_right" 'select-pane -R'
3333

34-
tmux bind-key -T copy-mode-vi "$navigation_kb_left" select-pane -L
35-
tmux bind-key -T copy-mode-vi "$navigation_kb_down" select-pane -D
36-
tmux bind-key -T copy-mode-vi "$navigation_kb_up" select-pane -U
37-
tmux bind-key -T copy-mode-vi "$navigation_kb_right" select-pane -R
38-
else
39-
tmux bind-key -n "$navigation_kb_left" if-shell "$is_vim" "send-keys $navigation_kb_left" "if -F '#{pane_at_left}' '' 'select-pane -L'"
40-
tmux bind-key -n "$navigation_kb_down" if-shell "$is_vim" "send-keys $navigation_kb_down" "if -F '#{pane_at_bottom}' '' 'select-pane -D'"
41-
tmux bind-key -n "$navigation_kb_up" if-shell "$is_vim" "send-keys $navigation_kb_up" "if -F '#{pane_at_top}' '' 'select-pane -U'"
42-
tmux bind-key -n "$navigation_kb_right" if-shell "$is_vim" "send-keys $navigation_kb_right" "if -F '#{pane_at_right}' '' 'select-pane -R'"
34+
tmux bind-key -T copy-mode-vi "$navigation_kb_left" select-pane -L
35+
tmux bind-key -T copy-mode-vi "$navigation_kb_down" select-pane -D
36+
tmux bind-key -T copy-mode-vi "$navigation_kb_up" select-pane -U
37+
tmux bind-key -T copy-mode-vi "$navigation_kb_right" select-pane -R
38+
else
39+
tmux bind-key -n "$navigation_kb_left" if-shell "$is_vim" "send-keys $navigation_kb_left" "if -F '#{pane_at_left}' '' 'select-pane -L'"
40+
tmux bind-key -n "$navigation_kb_down" if-shell "$is_vim" "send-keys $navigation_kb_down" "if -F '#{pane_at_bottom}' '' 'select-pane -D'"
41+
tmux bind-key -n "$navigation_kb_up" if-shell "$is_vim" "send-keys $navigation_kb_up" "if -F '#{pane_at_top}' '' 'select-pane -U'"
42+
tmux bind-key -n "$navigation_kb_right" if-shell "$is_vim" "send-keys $navigation_kb_right" "if -F '#{pane_at_right}' '' 'select-pane -R'"
4343

44-
tmux bind-key -T copy-mode-vi "$navigation_kb_left" "if -F '#{pane_at_left}' '' 'select-pane -L'"
45-
tmux bind-key -T copy-mode-vi "$navigation_kb_down" "if -F '#{pane_at_bottom}' '' 'select-pane -D'"
46-
tmux bind-key -T copy-mode-vi "$navigation_kb_up" "if -F '#{pane_at_top}' '' 'select-pane -U'"
47-
tmux bind-key -T copy-mode-vi "$navigation_kb_right" "if -F '#{pane_at_right}' '' 'select-pane -R'"
48-
fi
44+
tmux bind-key -T copy-mode-vi "$navigation_kb_left" "if -F '#{pane_at_left}' '' 'select-pane -L'"
45+
tmux bind-key -T copy-mode-vi "$navigation_kb_down" "if -F '#{pane_at_bottom}' '' 'select-pane -D'"
46+
tmux bind-key -T copy-mode-vi "$navigation_kb_up" "if -F '#{pane_at_top}' '' 'select-pane -U'"
47+
tmux bind-key -T copy-mode-vi "$navigation_kb_right" "if -F '#{pane_at_right}' '' 'select-pane -R'"
48+
fi
4949
fi
5050

5151
# resize
@@ -60,13 +60,13 @@ resize_kb_up=$(get_tmux_option "@tmux-nvim-resize-keybinding-up" 'M-k')
6060
resize_kb_right=$(get_tmux_option "@tmux-nvim-resize-keybinding-right" 'M-l')
6161

6262
if $resize_enabled; then
63-
tmux bind -n "$resize_kb_left" if-shell "$is_vim" "send-keys $resize_kb_left" "resize-pane -L $resize_step_x"
64-
tmux bind -n "$resize_kb_down" if-shell "$is_vim" "send-keys $resize_kb_down" "resize-pane -D $resize_step_y"
65-
tmux bind -n "$resize_kb_up" if-shell "$is_vim" "send-keys $resize_kb_up" "resize-pane -U $resize_step_y"
66-
tmux bind -n "$resize_kb_right" if-shell "$is_vim" "send-keys $resize_kb_right" "resize-pane -R $resize_step_x"
63+
tmux bind -n "$resize_kb_left" if-shell "$is_vim" "send-keys $resize_kb_left" "resize-pane -L $resize_step_x"
64+
tmux bind -n "$resize_kb_down" if-shell "$is_vim" "send-keys $resize_kb_down" "resize-pane -D $resize_step_y"
65+
tmux bind -n "$resize_kb_up" if-shell "$is_vim" "send-keys $resize_kb_up" "resize-pane -U $resize_step_y"
66+
tmux bind -n "$resize_kb_right" if-shell "$is_vim" "send-keys $resize_kb_right" "resize-pane -R $resize_step_x"
6767

68-
tmux bind-key -T copy-mode-vi "$resize_kb_left" resize-pane -L "$resize_step_x"
69-
tmux bind-key -T copy-mode-vi "$resize_kb_down" resize-pane -D "$resize_step_y"
70-
tmux bind-key -T copy-mode-vi "$resize_kb_up" resize-pane -U "$resize_step_y"
71-
tmux bind-key -T copy-mode-vi "$resize_kb_right" resize-pane -R "$resize_step_x"
68+
tmux bind-key -T copy-mode-vi "$resize_kb_left" resize-pane -L "$resize_step_x"
69+
tmux bind-key -T copy-mode-vi "$resize_kb_down" resize-pane -D "$resize_step_y"
70+
tmux bind-key -T copy-mode-vi "$resize_kb_up" resize-pane -U "$resize_step_y"
71+
tmux bind-key -T copy-mode-vi "$resize_kb_right" resize-pane -R "$resize_step_x"
7272
fi

0 commit comments

Comments
 (0)