Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pmendelski committed Sep 5, 2023
1 parent 9b9cd7c commit 10b9a31
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 64 deletions.
2 changes: 2 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ disable=SC1090
disable=SC1091
disable=SC2155
disable=SC2223
disable=SC2015
disable=SC2059
8 changes: 4 additions & 4 deletions bash/.bash/util/terminal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ declare -i verbose=0
declare -i force=0

askForConfirmation() {
[ $force != 0 ] && return 0
[ "$force" != 0 ] && return 0
printQuestion "$1 [Y/n] "
read -r response
case $response in
Expand Down Expand Up @@ -47,15 +47,15 @@ printResult() {
}

print() {
[ $silent = 0 ] && printf "$1"
[ "$silent" = 0 ] && printf "$1"
}

println() {
print "$1\n"
}

printColor() {
if [ $nocolor = 0 ]; then
if [ "$nocolor" = 0 ]; then
print "$1$2${COLOR_RESET}"
else
print "$2"
Expand Down Expand Up @@ -87,5 +87,5 @@ printInfo() {
}

printDebug() {
[ $verbose = 1 ] && println " $1"
[ "$verbose" = 1 ] && println " $1"
}
2 changes: 2 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ expectCommand() {
checkBashScripts() {
expectCommand shellcheck
local -r files="$(find . -type f -name "*.sh" \
-not -path "./.install/*" \
-not -path "*/deps/*" \
-not -path "*/plugins/*" \
-not -path "*/tmp/*" \
Expand All @@ -27,6 +28,7 @@ checkLuaScripts() {
expectCommand luacheck
echo -e "\n>>> Running Luacheck"
local -r files="$(find . -type f -name "*.lua" \
-not -path "./.install/*" \
-not -path "*/deps/*" \
-not -path "*/.luarocks/*" \
-not -path "*/tmp/*")"
Expand Down
6 changes: 4 additions & 2 deletions nvim/.nvim/lua/plugin/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ function _M.keymap()
map(
"n",
"<leader>gh",
":lua require('gitsigns').setqflist(0, { open = false }); require('telescope.builtin').quickfix({ prompt_title='Git hunks' })<cr>"
":lua require('gitsigns').setqflist(0, { open = false });"
.. "require('telescope.builtin').quickfix({ prompt_title='Git hunks' })<cr>"
)
map(
"n",
"<leader>ga",
":lua require('gitsigns').setqflist('all', { open = false }); require('telescope.builtin').quickfix({ prompt_title='Git workspace hunks' })<cr>"
":lua require('gitsigns').setqflist('all', { open = false });"
.. "require('telescope.builtin').quickfix({ prompt_title='Git workspace hunks' })<cr>"
)
end

Expand Down
98 changes: 49 additions & 49 deletions nvim/.nvim/lua/plugin/tokyonight.lua
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
local dcolors = require("tokyonight.colors").default
-- local dcolors = require("tokyonight.colors").default

require("tokyonight").setup({
on_highlights = function(hl, c)
-- local bg = c.bg
-- local prompt_bg = "#2d3149"
-- local preview_bg = dcolors.bg
-- Telescope - borderless
-- hl.TelescopeNormal = {
-- bg = bg,
-- fg = c.fg_dark,
-- }
-- hl.TelescopeBorder = {
-- bg = bg,
-- fg = bg,
-- }
-- -- Prompt (text field)
-- hl.TelescopePromptNormal = {
-- bg = prompt_bg,
-- }
-- hl.TelescopePromptBorder = {
-- bg = prompt_bg,
-- fg = prompt_bg,
-- }
-- hl.TelescopePromptTitle = {
-- bg = prompt_bg,
-- fg = c.comment,
-- }
-- -- Results (left column)
-- hl.TelescopeResultsTitle = {
-- bg = bg,
-- fg = bg,
-- }
-- -- Preview (right column)
-- hl.TelescopePreviewNormal = {
-- bg = preview_bg,
-- }
-- hl.TelescopePreviewBorder = {
-- bg = preview_bg,
-- fg = preview_bg,
-- }
-- hl.TelescopePreviewTitle = {
-- fg = c.comment,
-- }
-- Selection
-- hl.TelescopeSelection = { fg = c.magenta_dark, bg = bg_dark }
-- hl.TelescopeSelectionCaret = { fg = c.magenta }
-- Floats (borderless terminal - WIP)
-- hl.Normal = { bg = c.magenta, fg = c.blue }
-- hl.FloatBorder = { bg = preview_bg }
end,
-- on_highlights = function(hl, c)
-- local bg = c.bg
-- local prompt_bg = "#2d3149"
-- local preview_bg = dcolors.bg
-- Telescope - borderless
-- hl.TelescopeNormal = {
-- bg = bg,
-- fg = c.fg_dark,
-- }
-- hl.TelescopeBorder = {
-- bg = bg,
-- fg = bg,
-- }
-- -- Prompt (text field)
-- hl.TelescopePromptNormal = {
-- bg = prompt_bg,
-- }
-- hl.TelescopePromptBorder = {
-- bg = prompt_bg,
-- fg = prompt_bg,
-- }
-- hl.TelescopePromptTitle = {
-- bg = prompt_bg,
-- fg = c.comment,
-- }
-- -- Results (left column)
-- hl.TelescopeResultsTitle = {
-- bg = bg,
-- fg = bg,
-- }
-- -- Preview (right column)
-- hl.TelescopePreviewNormal = {
-- bg = preview_bg,
-- }
-- hl.TelescopePreviewBorder = {
-- bg = preview_bg,
-- fg = preview_bg,
-- }
-- hl.TelescopePreviewTitle = {
-- fg = c.comment,
-- }
-- Selection
-- hl.TelescopeSelection = { fg = c.magenta_dark, bg = bg_dark }
-- hl.TelescopeSelectionCaret = { fg = c.magenta }
-- Floats (borderless terminal - WIP)
-- hl.Normal = { bg = c.magenta, fg = c.blue }
-- hl.FloatBorder = { bg = preview_bg }
-- end,
})

-- vim.cmd("colorscheme tokyonight")
Expand Down
16 changes: 9 additions & 7 deletions nvim/.nvim/lua/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,18 @@ opt.expandtab = true -- use spaces for tabs
opt.shiftwidth = 4
opt.softtabstop = 4 -- number of spaces in tab when editing
opt.tabstop = 4 -- number of visual spaces per TAB

-- Wrapping options
opt.wrap = false
opt.formatoptions = opt.formatoptions + "tc" -- wrap text and comments using textwidth
opt.formatoptions = opt.formatoptions + "r" -- continue comments when pressing ENTER in I mode
opt.formatoptions = opt.formatoptions + "q" -- enable formatting of comments with gq
opt.formatoptions = opt.formatoptions + "n" -- detect lists for formatting
opt.formatoptions = opt.formatoptions + "b" -- auto-wrap in insert mode, and do not wrap old long lines
opt.formatoptions = opt.formatoptions + "tc" -- wrap text and comments using textwidth
opt.formatoptions = opt.formatoptions + "r" -- continue comments when pressing ENTER in I mode
opt.formatoptions = opt.formatoptions + "q" -- enable formatting of comments with gq
opt.formatoptions = opt.formatoptions + "n" -- detect lists for formatting
opt.formatoptions = opt.formatoptions + "b" -- auto-wrap in insert mode, and do not wrap old long lines

-- Whitespace characters
opt.list = true -- by default present whitecharacters
opt.listchars = "space:·,eol:¬,tab:▸ ,nbsp:_,trail:·,extends:»,precedes:«" -- secure mapping for white characters
opt.list = true -- present whitecharacters
opt.listchars = "space:·,eol:¬,tab:▸ ,nbsp:_,trail:·,extends:»,precedes:«" -- white characters

-- Spellcheck
-----------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions nvim/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ installNvimDependencies() {
printInfo "Installing nvim dependencies"
for file in $(find "$SDIR/deps" -mindepth 1 -maxdepth 1 -type f | sort | sed -n "s|^.*/||p"); do
printInfo "Installing nvim dependency: $file"
"$SDIR/deps/$file" &&
printSuccess "Installed nvim dependency: $file" ||
if "$SDIR/deps/$file"; then
printSuccess "Installed nvim dependency: $file"
else
printError "Could not install nvim dependency: $file"
fi
done
printInfo "To reinstall nvim dependencies run: nvim-install-deps"
printInfo "...or reinstall single nvim dependency with: nvim-install-dep NAME"
Expand Down
1 change: 1 addition & 0 deletions zsh/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ updatePlugins() {
local -r dotfileDirs="$(find "$HOME/.zsh/deps" -mindepth 1 -maxdepth 1 -type d | sort)"
for dir in $dotfileDirs; do
if [ -d "$dir/.git" ]; then
# shellcheck disable=SC1083
(cd "$dir" && git fetch --all && git reset --hard @{u})
fi
done
Expand Down

0 comments on commit 10b9a31

Please sign in to comment.