Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit 8506cbc

Browse files
chore: format source code
1 parent e0a3a11 commit 8506cbc

File tree

14 files changed

+126
-165
lines changed

14 files changed

+126
-165
lines changed

init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if vim.fn.has("nvim-0.6.0") ~= 1 then
88
end
99

1010
-- Makes sure ~/.local/share/nvim exists, to prevent problems with logging
11-
vim.fn.mkdir(vim.fn.stdpath("data"), 'p')
11+
vim.fn.mkdir(vim.fn.stdpath("data"), "p")
1212

1313
-- Add ~/.local/share to runtimepath early, such that
1414
-- neovim autoloads plugin/packer_compiled.lua along with vimscript,

lua/doom/core/doom_global.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ doom = {
166166
-- @default = false
167167
use_floating_win_packer = false,
168168

169-
-- Set max cols
170-
-- Defines the column to show a vertical marker
171-
-- Set to false to disable
172-
-- @default = 80
173-
max_columns = 80,
169+
-- Set max cols
170+
-- Defines the column to show a vertical marker
171+
-- Set to false to disable
172+
-- @default = 80
173+
max_columns = 80,
174174

175175
-- Default indent size
176176
-- @default = 4

lua/doom/core/functions.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ end
178178
-- Set the indent and tab related numbers.
179179
-- Negative numbers mean tabstop -- Really though? Tabs?
180180
functions.set_indent = function()
181-
local indent = tonumber(
182-
vim.fn.input("Set indent (>0 uses spaces, <0 uses tabs, 0 uses vim defaults): ")
183-
)
181+
local indent =
182+
tonumber(vim.fn.input("Set indent (>0 uses spaces, <0 uses tabs, 0 uses vim defaults): "))
184183
if not indent then
185184
indent = -8
186185
end

lua/doom/modules/core/reloader/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ reloader._reload_doom = function()
122122
return t[1]
123123
end, doom.packages)
124124
local needs_install = vim.deep_equal(modules, old_modules)
125-
and vim.deep_equal(packages, old_packages)
125+
and vim.deep_equal(packages, old_packages)
126126
if needs_install then
127127
if not _G._doom_reloader._has_shown_packer_compile_message then
128128
log.warn(
@@ -151,8 +151,8 @@ reloader.reload = function()
151151

152152
log.info(
153153
"Reloaded Doom in "
154-
.. vim.fn.printf("%.3f", vim.fn.reltimefloat(vim.fn.reltime(reload_time)))
155-
.. " seconds"
154+
.. vim.fn.printf("%.3f", vim.fn.reltimefloat(vim.fn.reltime(reload_time)))
155+
.. " seconds"
156156
)
157157
end
158158

lua/doom/modules/core/updater/init.lua

Lines changed: 61 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,40 @@ updater._cwd = vim.fn.stdpath("config")
3939
---@param callback function Handler to receive the list of versions
4040
updater._pull_tags = function(callback)
4141
local Job = require("plenary.job")
42-
Job
43-
:new({
44-
command = "git",
45-
args = { "fetch", "--tags", "--all" },
46-
cwd = updater._cwd,
47-
on_exit = function(j, exit_code)
48-
if exit_code ~= 0 then
49-
callback(nil, "Error pulling tags... \n\n " .. vim.inspect(j.result()))
50-
end
51-
callback(j:result())
52-
end,
53-
})
54-
:start()
42+
Job:new({
43+
command = "git",
44+
args = { "fetch", "--tags", "--all" },
45+
cwd = updater._cwd,
46+
on_exit = function(j, exit_code)
47+
if exit_code ~= 0 then
48+
callback(nil, "Error pulling tags... \n\n " .. vim.inspect(j.result()))
49+
end
50+
callback(j:result())
51+
end,
52+
}):start()
5553
end
5654

5755
--- Gets the current commit sha or error
5856
---@param callback function(commit_sha, error_string)
5957
updater._get_commit_sha = function(callback)
6058
local Job = require("plenary.job")
6159

62-
Job
63-
:new({
64-
command = "git",
65-
args = { "rev-parse", "HEAD" },
66-
on_exit = function(j, exit_code)
67-
if exit_code ~= 0 then
68-
callback(nil, "Error getting current commit... \n\n" .. vim.inspect(j:result()))
69-
return
70-
end
71-
local result = j:result()
72-
if #result == 1 then
73-
callback(result[1])
74-
else
75-
callback(nil, "Error getting current commit... No output.")
76-
end
77-
end,
78-
})
79-
:start()
60+
Job:new({
61+
command = "git",
62+
args = { "rev-parse", "HEAD" },
63+
on_exit = function(j, exit_code)
64+
if exit_code ~= 0 then
65+
callback(nil, "Error getting current commit... \n\n" .. vim.inspect(j:result()))
66+
return
67+
end
68+
local result = j:result()
69+
if #result == 1 then
70+
callback(result[1])
71+
else
72+
callback(nil, "Error getting current commit... No output.")
73+
end
74+
end,
75+
}):start()
8076
end
8177

8278
--- Given a version string, checks if it's an alpha/beta version
@@ -116,25 +112,23 @@ end
116112
---@param callback function(version_tag, error_string)
117113
updater._get_last_version_for_commit = function(commit_sha, callback)
118114
local Job = require("plenary.job")
119-
Job
120-
:new({
121-
command = "git",
122-
args = { "tag", "-l", "--sort", "-version:refname", "--merged", commit_sha },
123-
cwd = updater._cwd,
124-
on_exit = function(j, exit_code)
125-
if exit_code ~= 0 then
126-
callback(nil, "Error getting current version... \n\n " .. vim.inspect(j:result()))
127-
return
128-
end
129-
local result = j:result()
130-
if #result > 0 then
131-
callback(result[1])
132-
else
133-
callback(nil, "Error getting current version... No output.")
134-
end
135-
end,
136-
})
137-
:start()
115+
Job:new({
116+
command = "git",
117+
args = { "tag", "-l", "--sort", "-version:refname", "--merged", commit_sha },
118+
cwd = updater._cwd,
119+
on_exit = function(j, exit_code)
120+
if exit_code ~= 0 then
121+
callback(nil, "Error getting current version... \n\n " .. vim.inspect(j:result()))
122+
return
123+
end
124+
local result = j:result()
125+
if #result > 0 then
126+
callback(result[1])
127+
else
128+
callback(nil, "Error getting current version... No output.")
129+
end
130+
end,
131+
}):start()
138132
end
139133

140134
--- Gets the current version and the latest upstream version
@@ -255,25 +249,23 @@ end
255249
---@param callback function(branch_name, error)
256250
updater._get_branch_name = function(callback)
257251
local Job = require("plenary.job")
258-
Job
259-
:new({
260-
command = "git",
261-
args = { "symbolic-ref", "--short", "-q", "HEAD" },
262-
cwd = updater._cwd,
263-
on_exit = function(j, exit_code)
264-
if exit_code ~= 0 then
265-
callback(nil, "Error getting branch name... \n\n " .. vim.inspect(j:result()))
266-
return
267-
end
268-
local result = j:result()
269-
if #result > 0 then
270-
callback(result[1])
271-
else
272-
callback(nil, "Error getting branch name... No output.")
273-
end
274-
end,
275-
})
276-
:start()
252+
Job:new({
253+
command = "git",
254+
args = { "symbolic-ref", "--short", "-q", "HEAD" },
255+
cwd = updater._cwd,
256+
on_exit = function(j, exit_code)
257+
if exit_code ~= 0 then
258+
callback(nil, "Error getting branch name... \n\n " .. vim.inspect(j:result()))
259+
return
260+
end
261+
local result = j:result()
262+
if #result > 0 then
263+
callback(result[1])
264+
else
265+
callback(nil, "Error getting branch name... No output.")
266+
end
267+
end,
268+
}):start()
277269
end
278270

279271
--- Entry point for `:DoomUpdate`, fetches new tags, compares with current version and attempts to merge new tags into current branch

lua/doom/modules/features/extra_snippets/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
local extra_snippets = {}
22

3-
extra_snippets.settings = {
4-
}
3+
extra_snippets.settings = {}
54

65
extra_snippets.packages = {
76
["friendly-snippets"] = {
87
"rafamadriz/friendly-snippets",
9-
after = "LuaSnip"
8+
after = "LuaSnip",
109
},
1110
}
1211

lua/doom/modules/features/linter/init.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ linter.settings = {
44
format_on_save = false,
55
null_ls_settings = {
66
default_timeout = 2000,
7-
}
7+
},
88
}
99

1010
linter.packages = {
@@ -22,8 +22,9 @@ linter.configs["null-ls.nvim"] = function()
2222
local null_ls_settings = doom.features.linter.settings.null_ls_settings
2323
null_ls.setup(vim.tbl_deep_extend("force", null_ls_settings, {
2424
on_attach = function(client)
25-
if client.server_capabilities.documentFormattingProvider
26-
and doom.features.linter.settings.format_on_save
25+
if
26+
client.server_capabilities.documentFormattingProvider
27+
and doom.features.linter.settings.format_on_save
2728
then
2829
vim.cmd([[
2930
augroup LspFormatting
@@ -43,7 +44,7 @@ linter.binds = {
4344
local null_ls_settings = doom.features.linter.settings.null_ls_settings
4445
if type(vim.lsp.buf.format) == "function" then
4546
vim.lsp.buf.format({
46-
timeout_ms = null_ls_settings.default_timeout
47+
timeout_ms = null_ls_settings.default_timeout,
4748
})
4849
else
4950
vim.lsp.buf.formatting_sync(nil, null_ls_settings.default_timeout)

lua/doom/modules/features/lsp/init.lua

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ lsp.packages = {
105105
"hrsh7th/nvim-cmp",
106106
commit = "706371f1300e7c0acb98b346f80dad2dd9b5f679",
107107
requires = {
108-
"L3MON4D3/LuaSnip",
109-
commit = "53e812a6f51c9d567c98215733100f0169bcc20a",
110-
module = "luasnip",
111-
},
108+
"L3MON4D3/LuaSnip",
109+
commit = "53e812a6f51c9d567c98215733100f0169bcc20a",
110+
module = "luasnip",
111+
},
112112
},
113113
["cmp-nvim-lua"] = {
114114
"hrsh7th/cmp-nvim-lua",
@@ -242,11 +242,8 @@ lsp.configs["nvim-cmp"] = function()
242242
},
243243
formatting = {
244244
format = function(entry, item)
245-
item.kind = string.format(
246-
"%s %s",
247-
doom.features.lsp.settings.completion.kinds[item.kind],
248-
item.kind
249-
)
245+
item.kind =
246+
string.format("%s %s", doom.features.lsp.settings.completion.kinds[item.kind], item.kind)
250247
item.menu = source_map[entry.source.name]
251248
item.dup = vim.tbl_contains({ "path", "buffer" }, entry.source.name)
252249
return item

lua/doom/modules/features/repl/init.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ repl.configs = {
5050
local iron = require("iron.core")
5151

5252
local settings = vim.tbl_deep_extend("force", {}, doom.features.repl.settings)
53-
settings.config.repl_open_command = require("iron.view").curry[settings.config.position](
54-
settings.config.size
55-
)
53+
settings.config.repl_open_command =
54+
require("iron.view").curry[settings.config.position](settings.config.size)
5655

5756
iron.setup(settings)
5857
end,

lua/doom/modules/features/statusline/init.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,8 @@ statusline.configs["heirline.nvim"] = function()
251251
init = function(self)
252252
local filename = self.filename
253253
local extension = vim.fn.fnamemodify(filename, ":e")
254-
self.icon, self.icon_color = require("nvim-web-devicons").get_icon_color(
255-
filename,
256-
extension,
257-
{ default = true }
258-
)
254+
self.icon, self.icon_color =
255+
require("nvim-web-devicons").get_icon_color(filename, extension, { default = true })
259256
end,
260257
provider = function(self)
261258
return self.icon and (self.icon .. " ")

0 commit comments

Comments
 (0)