Skip to content

Commit

Permalink
Add more linters
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAbdi committed Nov 28, 2024
1 parent 2ee90ae commit 88322ff
Show file tree
Hide file tree
Showing 7 changed files with 738 additions and 51 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,4 @@ jobs:
with:
pixi-version: v0.22.0
cache: true
- run: |
pixi run pip install sourcery
pixi run sourcery login --token ${{ secrets.SOURCERY_TOKEN }}
- run: pixi run lint
10 changes: 1 addition & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ci:
skip: [refurb, luacheck, markdownlint, actionlint, sourcery]
skip: [refurb, luacheck, markdownlint, actionlint]
default_language_version:
python: python3.12
ruby: 2.7.2
Expand Down Expand Up @@ -99,14 +99,6 @@ repos:
rev: v1.6.24
hooks:
- id: actionlint
- repo: https://github.com/sourcery-ai/sourcery
rev: v1.25.0
hooks:
- id: sourcery
# The best way to use Sourcery in a pre-commit hook:
# * review only changed lines:
# * omit the summary
args: [--diff=git diff HEAD, --enable=gpsg, --enable=default, --no-summary]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
Expand Down
54 changes: 49 additions & 5 deletions neovim/.config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ local root_dirs = {
})
end,
cmake = function(startpath)
return vim.fs.root(startpath, { ".vscode", "package.xml", ".git" })
return vim.fs.root(startpath, { ".vscode" })
end,
cpp = function(startpath)
local search_fn = function(path)
Expand Down Expand Up @@ -752,6 +752,7 @@ local servers = {
},
python = {
{
lintAfterOpen = true,
lintCommand = vim.fs.joinpath(
vim.env.HOME,
"myconfigs",
Expand Down Expand Up @@ -782,6 +783,7 @@ local servers = {
formatStdin = true,
},
{
lintAfterOpen = true,
lintCommand = vim.fs.joinpath(
vim.env.HOME,
"myconfigs",
Expand All @@ -800,14 +802,30 @@ local servers = {
},
cmake = {
{
lintCommand = "cmake-lint",
lintAfterOpen = true,
lintCommand = vim.fs.joinpath(
vim.env.HOME,
"myconfigs",
".pixi",
"envs",
"linters",
"bin",
"cmake-lint"
) .. " ${INPUT}",
lintFormats = {
"%f:%l,%c: %m",
"%f:%l: %m",
},
lintSeverity = vim.diagnostic.severity.WARN,
},
{
formatCommand = "cmake-format -",
formatCommand = vim.fs.joinpath(
vim.env.HOME,
"myconfigs",
".pixi",
"envs",
"linters",
"bin",
"cmake-format -"
),
formatStdin = true,
},
},
Expand Down Expand Up @@ -975,6 +993,32 @@ local servers = {
filetypes = { "zig" },
cmd = { "zls" },
},
{
name = "cmake_language_server",
filetypes = { "cmake" },
cmd = {
vim.fs.joinpath(
vim.env.HOME,
"myconfigs",
".pixi",
"envs",
"cmake-lsp",
"bin",
"cmake-language-server"
),
},
init_options = function(file)
local root_dir = root_dirs.cmake(file)
if not root_dir then
return {}
end
local cmake_settings_filename = vim.fs.joinpath(root_dir, ".vscode", "settings.json")
local settings = vim.fn.json_decode(vim.fn.readfile(cmake_settings_filename))
return {
buildDirectory = settings["cmake.buildDirectory"],
}
end,
},
{
name = "jedi_language_server",
filetypes = { "python" },
Expand Down
Loading

0 comments on commit 88322ff

Please sign in to comment.