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

No output when using stdin #1508

Closed
varac opened this issue Mar 6, 2019 · 2 comments
Closed

No output when using stdin #1508

varac opened this issue Mar 6, 2019 · 2 comments

Comments

@varac
Copy link

varac commented Mar 6, 2019

For bugs

  • My shellcheck version (shellcheck --version or "online"): 0.6.0 (installed with stack intall ShellCheck) today

Here's a snippet or screenshot that shows the problem:

#!/bin/bash

set -euo pipefail

file_last_retag="$HOME/.offlineimap/Mail/.notmuch/last_retag"

# Before we sync via IMAP we need to move re-tagged mails
/home/varac/.local/bin/afew -m

. /home/varac/bin/include.d/check_connectivity

# fetch mail
timeout 2m ~/bin/old/offlineimap_concurrent.sh

# retag
if [ -f "$file_last_retag" ]
then
  rev_last_retag=$(tail -1 "$file_last_retag" | tr -d '\0' | cut -f4)
else
  rev_last_retag=0
fi

if ! [[ $rev_last_retag =~ ^[0-9]+$ ]]
then
  echo "Warning - Can't read last notmuch offset from $file_last_retag - Exiting."
  exit 1
fi

rev_lastmod=$(notmuch count --lastmod | cut -f3)
notmuch tag +new lastmod:"${rev_last_retag}..${rev_lastmod}"
notmuch new

# lastmod has changed after tagging
rev_lastmod=$(notmuch count --lastmod)
echo -e "$(date +%Y-%m-%d-%H:%M:%S)\t${rev_lastmod}" >> ~/.offlineimap/Mail/.notmuch/last_retag

notmuch address --format=sexp --output=recipients --deduplicate=address query:from-me > ~/.config/notmuch/addresses

Here's what shellcheck currently says:

Pointing shellcheck to the file directly shows one issue;

 ~/bin $ shellcheck -s bash ~/bin/fetch-mail.sh       

In /home/varac/bin/fetch-mail.sh line 10:
. /home/varac/bin/include.d/check_connectivity
  ^-- SC1091: Not following: /home/varac/bin/include.d/check_connectivity was not specified as input (see shellcheck -x).

For more information:
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /home/varac/bin/in...

When using stdin (like Vim ALE does) fails to show the issue:

 ~/bin $ shellcheck -s bash -x - < ~/bin/fetch-mail.sh
 ~/bin $

Here's what I wanted or expected to see:

@varac varac closed this as completed Mar 6, 2019
@varac
Copy link
Author

varac commented Mar 6, 2019

Damnit, my fault

@juanje
Copy link

juanje commented Sep 17, 2020

@varac what was your fault?

I have exactly the same problem you describe and I can't find what is the issue. Neither of these ways work for me (version: 0.7.0):

$ cat script.sh | shellcheck -

nor

$ shellcheck - < script.sh

I'll appreciate if you could tell me if you did find something missing or wrong there.
Thanks.

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