deb-python-bashate/bashate/tests/samples
Ian Wienand 649c7dc799 Ignore heredoc contents
I noticed that we end up treating a heredoc as one big logical line,
then passing it through things like the line-length check.  So

cat <<EOF
this is normal lines
that get picked up as a long line!
EOF

end up triggering the long-line exception ... clearly not what is
intended.

In fact, there's not much we can do with heredocs.  They are usually
some weird syntax for a config file, or something else you're writing
out in bulk.  Often they have offsets that just don't match what we
want, etc.

Thus most logical thing to do seems to be to just ignore whatever is
in the heredoc.

I also noticed we don't handle <<'EOF', which is another common idiom,
so add that to the regex.  Also add a test-case to ensure we're
ignoring the heredoc contents.

Change-Id: I2e3d66f27ff4c0d1f542511ca3e19c29a596896f
2016-02-09 14:57:30 +11:00
..
E001_bad.sh the great rename of bash8 -> bashate 2014-06-20 16:41:12 -04:00
E002_bad.sh the great rename of bash8 -> bashate 2014-06-20 16:41:12 -04:00
E005_bad Add #! or .sh test at warning level 2015-02-12 11:49:59 +11:00
E006_bad.sh add E006: check for lines longer than 79 columns 2015-05-04 17:58:37 +01:00
E006_good.sh add E006: check for lines longer than 79 columns 2015-05-04 17:58:37 +01:00
E010_bad.sh Removed \b that don't work anyway 2014-10-30 17:15:05 -07:00
E010_good.sh Removed \b that don't work anyway 2014-10-30 17:15:05 -07:00
E011_bad.sh Removed \b that don't work anyway 2014-10-30 17:15:05 -07:00
E011_good.sh Removed \b that don't work anyway 2014-10-30 17:15:05 -07:00
E012_bad.sh Replace heredoc fail-to-end detection E012 with "bash -n" 2016-02-09 14:57:25 +11:00
E040_syntax_error.sh Add shallow syntax checking 2015-10-15 16:50:06 +01:00
E041_bad.sh Add a check for $[ 2014-10-14 09:57:19 +11:00
E042_bad.sh Detect setting locals with subshell commands 2015-10-06 20:30:04 +11:00
comments.sh Strip comments before checks 2014-10-28 12:35:36 +00:00
for_loops.sh Check for bash-like "for" 2014-10-21 13:33:18 +11:00
heredoc_ignore.sh Ignore heredoc contents 2016-02-09 14:57:30 +11:00
legacy_sample.sh the great rename of bash8 -> bashate 2014-06-20 16:41:12 -04:00