From ec5c3ae76505b928794f9e35e6984d5d95a89d6e Mon Sep 17 00:00:00 2001 From: Felipe Silveira Date: Mon, 29 Jul 2024 05:36:42 +0100 Subject: [PATCH] chore(lua): consolidate lint and editor configs --- .editorconfig | 8 +++++ .gitignore | 53 ++++++++++++++++++++++++++--- .luacheckrc | 24 ++++++++++--- .luarc.json | 8 ++--- nvim/.neoconf.json => .neoconf.json | 0 CHANGELOG.md | 3 ++ LICENSE | 21 ++++++++++++ nvim/stylua.toml | 3 -- stylua.toml | 10 ++++++ 9 files changed, 113 insertions(+), 17 deletions(-) create mode 100644 .editorconfig rename nvim/.neoconf.json => .neoconf.json (100%) create mode 100644 LICENSE delete mode 100644 nvim/stylua.toml create mode 100644 stylua.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..631dfad --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +charset = utf-8 diff --git a/.gitignore b/.gitignore index 78c3455..9f9d02d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,15 @@ +# Spelling, sops, personal tmux profiles, fzf binaries .fzf/ .tmuxp/ *.dec *.spl +# Hammerspoon Spoons +hammerspoon/Spoons/ + +# BFG +..bfg-report/ + # LazyVim ./nvim/tt.* ./nvim/.tests @@ -18,8 +25,46 @@ node_modules/ package.json package-lock.json -# BFG -..bfg-report/ +# Compiled Lua, Luarocks +luac.out +/luarocks.bat +/lua.bat +/lua_modules +/.luarocks +*.src.rock -# Hammerspoon Spoons -hammerspoon/Spoons/ +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects +*.dll +*.so +*.so.* +*.dylib +.DS_Store + +# Executables and binaries in general +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex +*.zip +*.tar.gz diff --git a/.luacheckrc b/.luacheckrc index 1fdeee1..0b82ef3 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,5 +1,21 @@ -std = "luajit" -globals = { "vim", "LazyVim" } +-- vim: ft=lua tw=80 + +std = 'luajit' +globals = { 'vim', 'LazyVim' } cache = true -include_files = { "nvim/*.lua", "nvim/*/*.lua", "nvim/*/*/*.lua", "*.luacheckrc" } -exclude_files = { "src/luacheck/vendor" } +include_files = { 'nvim/*.lua', 'nvim/*/*.lua', 'nvim/*/*/*.lua', '*.luacheckrc' } +exclude_files = { 'src/luacheck/vendor' } +max_line_length = 150 +max_comment_line_length = 200 +files['wezterm/utils/backdrops.lua'] = { ignore = { '212' } } + +-- Rerun tests only if their modification time changed +cache = true + +-- Don't report unused self arguments of methods +self = false + +-- ignore = { +-- '631', -- max_line_length +-- '212/_.*', -- unused argument, for vars with "_" prefix +-- } diff --git a/.luarc.json b/.luarc.json index 5046826..d9a4dfe 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,8 +1,4 @@ { - "diagnostics.globals": [ - "vim", - "args", - "hs", - "spoon" - ] + "diagnostics.globals": ["vim", "args", "hs", "spoon"], + "workspace.checkThirdParty": false } diff --git a/nvim/.neoconf.json b/.neoconf.json similarity index 100% rename from nvim/.neoconf.json rename to .neoconf.json diff --git a/CHANGELOG.md b/CHANGELOG.md index e5058a7..d373502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### [2024-07-29] + * [[3827df2]](https://github.com/silveiralexf/.dotfiles/commit/3827df247722b624f173bb5b068cc503e0ed0b25) chore: reorg config files and scripts (silveiralexf@gmail.com) + + * [[67f41a9]](https://github.com/silveiralexf/.dotfiles/commit/67f41a9a2c13713ad8b5de55cb38e8c940076a6f) chore(terminal): replace kitty with wezterm (silveiralexf@gmail.com) diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b0c146c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 silveiralexf@gmail.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/nvim/stylua.toml b/nvim/stylua.toml deleted file mode 100644 index edda183..0000000 --- a/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 160 diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..ea0d12a --- /dev/null +++ b/stylua.toml @@ -0,0 +1,10 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 +line_endings = "Unix" +quote_style = "AutoPreferSingle" +call_parentheses = "Always" +collapse_simple_statement = "Never" + +[sort_requires] +enabled = true