[vim/vim] Fix shellcheck compiler for shell scripts (PR #11509)

23 views
Skip to first unread message

Balki

unread,
Nov 5, 2022, 11:17:35 PM11/5/22
to vim/vim, Subscribed

Problem: :compiler shellcheck does not work
Solution: Add ' %' to makeprg to pass current file to shellcheck


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/11509

Commit Summary

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11509@github.com>

Balki

unread,
Nov 5, 2022, 11:22:41 PM11/5/22
to vim/vim, Subscribed

@dkearns Please approve. Currently it is broken when running :make

No files specified.

Usage: shellcheck [OPTIONS...] FILES...
  -a                  --check-sourced            Include warnings from sourced files
  -C[WHEN]            --color[=WHEN]             Use color (auto, always, never)
  -i CODE1,CODE2..    --include=CODE1,CODE2..    Consider only given types of warnings
...


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11509/c1304705572@github.com>

Doug Kearns

unread,
Nov 5, 2022, 11:44:24 PM11/5/22
to vim/vim, Subscribed

Thanks for the report, however, leaving the file argument empty is actually intentional. Doing so offers the flexibility to specify
files other than the current buffer when running :make. This might make more sense if you consider setting the options globally with :compiler!.

As you may be aware you can change the behaviour for yourself by adding the line in your patch to ~/.vim/after/compiler/shellcheck.vim.

There's some relevant discussion in this issue: #3328


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11509/c1304707837@github.com>

Gary Johnson

unread,
Nov 6, 2022, 12:38:35 AM11/6/22
to reply+ACY5DGBUBBOFJT32BA...@reply.github.com, vim...@googlegroups.com
On 2022-11-05, Balki wrote:
> Problem: :compiler shellcheck does not work
> Solution: Add ' %' to makeprg to pass current file to shellcheck

The 'makeprg' set by compiler files generally does not include %.
If the user wishes to make the current file, then they supply the
% themselves.

Regards,
Gary

vim-dev ML

unread,
Nov 6, 2022, 12:38:53 AM11/6/22
to vim/vim, vim-dev ML, Your activity

On 2022-11-05, Balki wrote:
> Problem: :compiler shellcheck does not work
> Solution: Add ' %' to makeprg to pass current file to shellcheck

The 'makeprg' set by compiler files generally does not include %.
If the user wishes to make the current file, then they supply the
% themselves.

Regards,
Gary


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/11509/c1304713454@github.com>

Balki

unread,
Nov 6, 2022, 8:49:13 AM11/6/22
to vim/vim, vim-dev ML, Comment

Closed #11509.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/11509/issue_event/7747338429@github.com>

Balki

unread,
Nov 6, 2022, 8:49:13 AM11/6/22
to vim/vim, vim-dev ML, Comment

Thank you for clarifying. Makes sense. Just realized it is very helpful to type :make **/*sh to see errors from all scripts in a project.


Reply to this email directly, view it on GitHub.

You are receiving this because you commented.Message ID: <vim/vim/pull/11509/c1304805663@github.com>

Reply all
Reply to author
Forward
0 new messages