Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow command line to define root for external-sources check #510

Closed
knirch opened this issue Oct 16, 2015 · 1 comment
Closed

Allow command line to define root for external-sources check #510

knirch opened this issue Oct 16, 2015 · 1 comment

Comments

@knirch
Copy link

knirch commented Oct 16, 2015

It might|would be nice if something like

knirch@traktor:~/source/linux-dist$ shellcheck -x --root-path=$PWD -f gcc $(git grep -l '^#!/bin/bash')

would let shellcheck translate "source /usr/lib/shell/db-functions" to "source /home/knirch/linux-dist/usr/lib/shell/db-function"

I do know about the source=file directive, but it's going to add lots of noise;
$ shellcheck -f gcc $(git grep -l '^#!/bin/bash' ) | grep -c SC1091
628

I could perhaps move some parts to dotfiles, but that would sadly remove the benefit of source checking.

@koalaman
Copy link
Owner

With 301705e you can now do this with -P "$PWD", which changes the search path both for what's considered the root in absolute paths, and for the base path of relative paths.

This should probably also be part of the new .shellcheckrc functionality, but isn't yet.

(Happy 3.5 year anniversary for this issue!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants