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

SC1090 - how to follow a remote file? #2012

Closed
joergi opened this issue Jul 12, 2020 · 2 comments
Closed

SC1090 - how to follow a remote file? #2012

joergi opened this issue Jul 12, 2020 · 2 comments

Comments

@joergi
Copy link

joergi commented Jul 12, 2020

SC1090 - Can't follow non-constant source. Use a directive to specify location.

I understand, that if I load a file in a another directory, I have to specify it, as mentioned here

If you see my pull request, I load a script from another github repository.
I haven't seen anything in the documentation, how to follow a remote file.

#!/bin/bash

# shellcheck source=https://raw.githubusercontent.com/joergi/downloader/master/linux_mac/downloader.sh
source <(curl -s https://raw.githubusercontent.com/joergi/downloader/master/linux_mac/downloader.sh) "$downloadUrl" "$recentIssue" "$@"

Here's what shellcheck currently says:

source <(curl -s https://raw.githubusercontent.com/joergi/downloader/master/linux_mac/downloader.sh) "$downloadUrl" "$recentIssue" "$@"
       ^-- SC1091: Not following: https://raw.githubusercontent.com/joergi/downloader/master/linux_mac/downloader.sh was not specified as input (see shellcheck -x).

This is now showing SC1091 - but if I don't have the # shellcheck source=https://raw.githubusercontent.com/joergi/downloader/master/linux_mac/downloader.sh, I got the SC1090

Here's what I wanted or expected to see:

I wanted to know, if I should ignore the one with # shellcheck disable=SC1090 of if there is a possibility to check it, even it is a remote file.

@joergi joergi changed the title SC1090 - Can't follow non-constant source. Use a directive to specify location. SC1090 - how to follow a remote file? Jul 12, 2020
@koalaman
Copy link
Owner

ShellCheck does not support downloading files. My suggestion would be one of:

  • Use bash instead of source since it appears that you simply want to run this script, not necessarily source it
  • Just #shellcheck source=/dev/null to ignore the file, since checking this file would be up to the repo in which it lives and not yours

@joergi
Copy link
Author

joergi commented Jul 13, 2020

Thx a lot. Maybe a note in the Readme for SC1090 would be nice? Or is this too obvious?

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