Skip to content

Commit 08d8472

Browse files
committed
build: update stylua to 15.2 and apply changes
1 parent 514bef7 commit 08d8472

File tree

7 files changed

+50
-80
lines changed

7 files changed

+50
-80
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
- main
66
- v1.x
77
- v2.x
8+
- v3.x
89
pull_request:
910
branches:
1011
- main
@@ -16,11 +17,11 @@ jobs:
1617
- uses: actions/checkout@v1
1718

1819
- name: Check formatting
19-
uses: JohnnyMorganz/stylua-action@1.0.0
20+
uses: JohnnyMorganz/stylua-action@2.0.0
2021
with:
2122
token: ${{ secrets.GITHUB_TOKEN }}
22-
version: v0.13.1
23-
args: --color always --check lua/
23+
version: v0.15.2
24+
args: --color always --check -g '!**/defaults.lua' lua/
2425

2526
plenary-tests:
2627
runs-on: ubuntu-20.04
@@ -54,6 +55,7 @@ jobs:
5455
with:
5556
path: ~/.local/share/luver
5657
key: ${{ steps.luver-cache-key.outputs.value }}
58+
5759
- name: Setup Lua
5860
uses: MunifTanjim/luver-action@v1
5961
with:

lua/neo-tree/log.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,8 @@ end
5757
log.new = function(config, standalone)
5858
config = vim.tbl_deep_extend("force", default_config, config)
5959

60-
local outfile = string.format(
61-
"%s/%s.log",
62-
vim.api.nvim_call_function("stdpath", { "data" }),
63-
config.plugin
64-
)
60+
local outfile =
61+
string.format("%s/%s.log", vim.api.nvim_call_function("stdpath", { "data" }), config.plugin)
6562

6663
local obj
6764
if standalone then

lua/neo-tree/setup/deprecations.lua

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ M.migrate = function(config)
4141
end
4242
utils.set_value(config, new, exising)
4343
config[old] = nil
44-
migrations[#migrations + 1] = string.format(
45-
"The `%s` option has been deprecated, please use `%s` instead.",
46-
old,
47-
new
48-
)
44+
migrations[#migrations + 1] =
45+
string.format("The `%s` option has been deprecated, please use `%s` instead.", old, new)
4946
end
5047
end
5148

@@ -61,12 +58,8 @@ M.migrate = function(config)
6158
local value = utils.get_value(config, key)
6259
if value == old_value then
6360
utils.set_value(config, key, new_value)
64-
migrations[#migrations + 1] = string.format(
65-
"The `%s=%s` option has been renamed to `%s`.",
66-
key,
67-
old_value,
68-
new_value
69-
)
61+
migrations[#migrations + 1] =
62+
string.format("The `%s=%s` option has been renamed to `%s`.", key, old_value, new_value)
7063
end
7164
end
7265

lua/neo-tree/sources/filesystem/lib/filter_external.lua

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,40 +138,38 @@ M.find_files = function(opts)
138138
end
139139
local item_count = 0
140140
local over_limit = false
141-
Job
142-
:new({
143-
command = cmd,
144-
cwd = path,
145-
args = args,
146-
enable_recording = false,
147-
on_stdout = function(err, line)
148-
if not over_limit then
149-
if opts.on_insert then
150-
opts.on_insert(err, line)
151-
end
152-
item_count = item_count + 1
153-
over_limit = maximum_results and item_count > maximum_results
141+
Job:new({
142+
command = cmd,
143+
cwd = path,
144+
args = args,
145+
enable_recording = false,
146+
on_stdout = function(err, line)
147+
if not over_limit then
148+
if opts.on_insert then
149+
opts.on_insert(err, line)
154150
end
155-
end,
156-
on_stderr = function(err, line)
157-
if not over_limit then
158-
if opts.on_insert then
159-
if not err then
160-
err = line
161-
end
162-
opts.on_insert(err, line)
151+
item_count = item_count + 1
152+
over_limit = maximum_results and item_count > maximum_results
153+
end
154+
end,
155+
on_stderr = function(err, line)
156+
if not over_limit then
157+
if opts.on_insert then
158+
if not err then
159+
err = line
163160
end
164-
item_count = item_count + 1
165-
over_limit = maximum_results and item_count > maximum_results
166-
end
167-
end,
168-
on_exit = function(_, return_val)
169-
if opts.on_exit then
170-
opts.on_exit(return_val)
161+
opts.on_insert(err, line)
171162
end
172-
end,
173-
})
174-
:start()
163+
item_count = item_count + 1
164+
over_limit = maximum_results and item_count > maximum_results
165+
end
166+
end,
167+
on_exit = function(_, return_val)
168+
if opts.on_exit then
169+
opts.on_exit(return_val)
170+
end
171+
end,
172+
}):start()
175173
end
176174

177175
return M

lua/neo-tree/ui/highlights.lua

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,8 @@ M.get_faded_highlight_group = function(hl_group_name, fade_percentage)
191191
local green = (f_green * fade_percentage) + (b_green * (1 - fade_percentage))
192192
local blue = (f_blue * fade_percentage) + (b_blue * (1 - fade_percentage))
193193

194-
local new_foreground = string.format(
195-
"%s%s%s",
196-
dec_to_hex(red, 2),
197-
dec_to_hex(green, 2),
198-
dec_to_hex(blue, 2)
199-
)
194+
local new_foreground =
195+
string.format("%s%s%s", dec_to_hex(red, 2), dec_to_hex(green, 2), dec_to_hex(blue, 2))
200196

201197
M.create_highlight_group(key, {}, hl_group.background, new_foreground, gui)
202198
faded_highlight_group_cache[key] = key
@@ -220,12 +216,8 @@ M.setup = function()
220216

221217
M.create_highlight_group(M.END_OF_BUFFER, { "EndOfBuffer" })
222218

223-
local float_border_hl = M.create_highlight_group(
224-
M.FLOAT_BORDER,
225-
{ "FloatBorder" },
226-
normalnc_hl.background,
227-
"444444"
228-
)
219+
local float_border_hl =
220+
M.create_highlight_group(M.FLOAT_BORDER, { "FloatBorder" }, normalnc_hl.background, "444444")
229221

230222
M.create_highlight_group(M.FLOAT_TITLE, {}, float_border_hl.background, normal_hl.foreground)
231223

lua/neo-tree/ui/renderer.lua

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -284,13 +284,8 @@ end
284284
M.render_component = function(component, item, state, remaining_width)
285285
local component_func = state.components[component[1]]
286286
if component_func then
287-
local success, component_data, wanted_width = pcall(
288-
component_func,
289-
component,
290-
item,
291-
state,
292-
remaining_width
293-
)
287+
local success, component_data, wanted_width =
288+
pcall(component_func, component, item, state, remaining_width)
294289
if success then
295290
if component_data == nil then
296291
return { {} }
@@ -361,12 +356,8 @@ local prepare_node = function(item, state)
361356
remaining_cols = math.min(remaining_cols, longest + 4)
362357
end
363358
for _, component in ipairs(renderer) do
364-
local component_data, component_wanted_width = M.render_component(
365-
component,
366-
item,
367-
state,
368-
remaining_cols
369-
)
359+
local component_data, component_wanted_width =
360+
M.render_component(component, item, state, remaining_cols)
370361
local actual_width = 0
371362
if component_data then
372363
for _, data in ipairs(component_data) do

lua/neo-tree/ui/selector.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,8 @@ M.get = function()
227227
return
228228
else
229229
local config = require("neo-tree").config
230-
local scrolled_off = utils.resolve_config_option(
231-
config,
232-
"source_selector.show_scrolled_off_parent_node",
233-
false
234-
)
230+
local scrolled_off =
231+
utils.resolve_config_option(config, "source_selector.show_scrolled_off_parent_node", false)
235232
if scrolled_off then
236233
local node_text = M.get_scrolled_off_node_text(state)
237234
if node_text ~= nil then

0 commit comments

Comments
 (0)