community.general/lib/ansible/plugins/callback
Marius Gedminas 0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
2017-01-09 11:49:03 -05:00
..
__init__.py Improve --diff output when files lack trailing newlines 2017-01-09 11:49:03 -05:00
actionable.py
context_demo.py
debug.py
default.py allow modules to set custom stats (#18946) 2017-01-05 16:38:36 -05:00
dense.py
foreman.py
hipchat.py
jabber.py
json.py
junit.py
log_plays.py
logentries.py
logstash.py
mail.py
minimal.py Ensure that command/shell errors are displayed 2016-12-16 21:46:02 -05:00
oneline.py Ensure that command/shell errors are displayed 2016-12-16 21:46:02 -05:00
osx_say.py
profile_tasks.py Removed dict.iteritems() in several other files. 2016-12-14 08:01:45 -08:00
profile_tasks.rst
skippy.py
slack.py
syslog_json.py runner_on_async_failed missing arg 2016-12-22 16:55:46 -08:00
timer.py
tree.py