{"thread":{"id":"33606","subject":"[PATCH] check-non-portable-shell: export X=Y usage","startedAt":"2013-04-25T18:48:44Z","lastAt":"2013-04-25T18:48:44Z","messageCount":1,"participants":["Torsten Bögershausen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"215472","messageId":"201304252048.45137.tboegi@web.de","threadId":"33606","inReplyTo":null,"subject":"[PATCH] check-non-portable-shell: export X=Y usage","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2013-04-25T18:48:44Z","receivedAt":"2013-04-25T18:48:44Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"The make test-lint could check for lines like\nexport X=Y\n\nThis is bash syntax and should be written in 2 lines:\nX=Y\nexport X\n\nSigned-off-by: Torsten Bögershausen <tboegi@web.de>\n---\n t/check-non-portable-shell.pl | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl\nindex 1ca8c8b..6a11b02 100755\n--- a/t/check-non-portable-shell.pl\n+++ b/t/check-non-portable-shell.pl\n@@ -11,7 +11,7 @@ my $bashmode=0;\n \n sub err {\n \tmy $msg = shift;\n-\tprint \"$ARGV:$.: error: (bashmode=$bashmode) $msg: $_\\n\";\n+\tprint \"$ARGV:$.: error: $msg: $_\\n\";\n \t$exit_code = 1;\n }\n \n@@ -25,6 +25,7 @@ while (<>) {\n \t/^\\s*declare\\s+/ and err 'arrays/declare not portable';\n \t/^\\s*[^#]\\s*which\\s/ and err 'which is not portable (please use type)';\n \t$bashmode==0 and /test\\s+[^=]*==/ and err '\"test a == b\" is not portable (please use =)';\n+\t$bashmode==0 and /^\\s*export\\s+\\S+=\\S+/ and err '\"export X=Y\" is not portable (please split into 2 lines)';\n \t# this resets our $. for each file\n \tclose ARGV if eof;\n \t$bashmode=0 if eof;\n-- \n1.8.2.1.614.g66d7af5\n"}]}