0
0
mirror of https://github.com/vim/vim.git synced 2025-11-13 22:54:27 -05:00

runtime(compiler): do not override &l:makeprg on :compiler!

closes: #18686

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Konfekt
2025-11-06 19:47:36 +00:00
committed by Christian Brabandt
parent 7dfdc7f6cb
commit 84baba329a
4 changed files with 16 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
" vim compiler file " vim compiler file
" Compiler: cppcheck (C++ static checker) " Compiler: cppcheck (C++ static checker)
" Maintainer: Vincent B. (twinside@free.fr) " Maintainer: Vincent B. (twinside@free.fr)
" Last Change: 2024 Nov 19 by @Konfekt " Last Change: 2025 Nov 06 by @Konfekt
if exists("current_compiler") | finish | endif if exists("current_compiler") | finish | endif
let current_compiler = "cppcheck" let current_compiler = "cppcheck"
@@ -18,14 +18,14 @@ if !exists('g:c_cppcheck_params')
let s:undo_compiler = 'unlet! g:c_cppcheck_params' let s:undo_compiler = 'unlet! g:c_cppcheck_params'
endif endif
let &l:makeprg = 'cppcheck --quiet' exe 'CompilerSet makeprg=' .. escape('cppcheck --quiet'
\ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"' \ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"'
\ ..' '..get(b:, 'c_cppcheck_params', get(g:, 'c_cppcheck_params', (&filetype ==# 'cpp' ? ' --language=c++' : ''))) \ ..' '..get(b:, 'c_cppcheck_params', get(g:, 'c_cppcheck_params', (&filetype ==# 'cpp' ? ' --language=c++' : '')))
\ ..' '..get(b:, 'c_cppcheck_includes', get(g:, 'c_cppcheck_includes', \ ..' '..get(b:, 'c_cppcheck_includes', get(g:, 'c_cppcheck_includes',
\ (filereadable('compile_commands.json') ? '--project=compile_commands.json' : \ (filereadable('compile_commands.json') ? '--project=compile_commands.json' :
\ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] : \ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] :
\ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I'))))) \ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I'))))),
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"') \ ' \|"')
CompilerSet errorformat= CompilerSet errorformat=
\%f:%l:%c:\ %tarning:\ %m, \%f:%l:%c:\ %tarning:\ %m,

View File

@@ -1,7 +1,7 @@
" Vim compiler file " Vim compiler file
" Compiler: Mypy (Python static checker) " Compiler: Mypy (Python static checker)
" Maintainer: @Konfekt " Maintainer: @Konfekt
" Last Change: 2024 Nov 19 " Last Change: 2025 Nov 06
if exists("current_compiler") | finish | endif if exists("current_compiler") | finish | endif
let current_compiler = "mypy" let current_compiler = "mypy"
@@ -10,9 +10,9 @@ let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" CompilerSet makeprg=mypy " CompilerSet makeprg=mypy
let &l:makeprg = 'mypy --show-column-numbers ' exe 'CompilerSet makeprg=' .. escape('mypy --show-column-numbers '
\ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports')) \ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports')),
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"') \ ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m
let &cpo = s:cpo_save let &cpo = s:cpo_save

View File

@@ -3,6 +3,7 @@
" Maintainer: Daniel Moch <daniel@danielmoch.com> " Maintainer: Daniel Moch <daniel@danielmoch.com>
" Last Change: 2024 Nov 07 by The Vim Project (added params variable) " Last Change: 2024 Nov 07 by The Vim Project (added params variable)
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting) " 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
if exists("current_compiler") | finish | endif if exists("current_compiler") | finish | endif
let current_compiler = "pylint" let current_compiler = "pylint"
@@ -11,10 +12,10 @@ let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" CompilerSet makeprg=ruff " CompilerSet makeprg=ruff
let &l:makeprg = 'pylint ' . exe 'CompilerSet makeprg=' .. escape('pylint ' .
\ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' . \ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' .
\ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0')) \ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0')),
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"') \ ' \|"')
CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%# CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%#
let &cpo = s:cpo_save let &cpo = s:cpo_save

View File

@@ -3,6 +3,7 @@
" Maintainer: @pbnj-dragon " Maintainer: @pbnj-dragon
" Last Change: 2024 Nov 07 " Last Change: 2024 Nov 07
" 2024 Nov 19 by the Vim Project (properly escape makeprg setting) " 2024 Nov 19 by the Vim Project (properly escape makeprg setting)
" 2025 Nov 06 by the Vim Project (do not set buffer-local makeprg)
if exists("current_compiler") | finish | endif if exists("current_compiler") | finish | endif
let current_compiler = "ruff" let current_compiler = "ruff"
@@ -11,9 +12,9 @@ let s:cpo_save = &cpo
set cpo&vim set cpo&vim
" CompilerSet makeprg=ruff " CompilerSet makeprg=ruff
let &l:makeprg= 'ruff check --output-format=concise ' exe 'CompilerSet makeprg=' .. escape('ruff check --output-format=concise '
\ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview')) \ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview')),
exe 'CompilerSet makeprg='..escape(&l:makeprg, ' \|"') \ ' \|"')
CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f: CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f:
let &cpo = s:cpo_save let &cpo = s:cpo_save