[PATCH] test: notmuch_drop_mail_headers() style update

classic Classic list List threaded Threaded
2 messages Options
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|

[PATCH] test: notmuch_drop_mail_headers() style update

Changed "" quotes to '' as we're not supposed to dynamically
alter python program (via shell $variable expansion).

Added space to python program to match general python style.

Replaced $* with 'idiomatic' "$@" to serve as better example.
---

It seems `email` headers is not dictionary; hdr.pop(x) does
not exist, and del hdr[x] on nonexistent header does not
raise KeyError. Fine.

We use both "${@}" and "$@". IMO "${@}" is ugly when unnecessary.

 test/test-lib.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/test-lib.sh b/test/test-lib.sh
index 09ee815d..35024649 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -509,12 +509,12 @@ NOTMUCH_DUMP_TAGS ()
 
 notmuch_drop_mail_headers ()
 {
-    $NOTMUCH_PYTHON -c "
-import email,sys
-msg=email.message_from_file(sys.stdin)
+    $NOTMUCH_PYTHON -c '
+import email, sys
+msg = email.message_from_file(sys.stdin)
 for hdr in sys.argv[1:]: del msg[hdr]
 print(msg.as_string(False))
-" $*
+' "$@"
 }
 
 notmuch_search_sanitize ()
--
2.13.3

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] test: notmuch_drop_mail_headers() style update

Tomi Ollila <[hidden email]> writes:

> Changed "" quotes to '' as we're not supposed to dynamically
> alter python program (via shell $variable expansion).
>
> Added space to python program to match general python style.
>
> Replaced $* with 'idiomatic' "$@" to serve as better example.

pushed

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch