deb-python-bashate/bashate
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
..
tests Ignore heredoc contents 2016-02-09 14:57:30 +11:00
__init__.py Remove unneeded definitions of Python Source Code Encoding 2014-07-31 13:37:38 +02:00
bashate.py Ignore heredoc contents 2016-02-09 14:57:30 +11:00
messages.py Replace heredoc fail-to-end detection E012 with "bash -n" 2016-02-09 14:57:25 +11:00