git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/4] test: Add target test-lint-shell-syntax

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 2, 2013, 16:28 UTC
Message-ID
<7vmwwr4kiq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130102094635.GD9328@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 29 quoted lines
> So taking all of that, a more idiomatic perl script would look something
> like:
>
>   my $exit_code;
>   sub err {
>     my $msg = shift;
>     print "$ARGV:$.: error: $msg: $_\n";
>     $exit_code = 1;
>   }
>
>   while (<>) {
>     chomp;
>     if (/^\s*sed\s+-i/) {
>       err('sed -i is not portable');
>     }
>     # ...and so on
>
>     # this resets our $. for each file
>     close ARGV if eof;
>   }
>   exit $exit_code;
>
> I'd personally probably write the conditions like:
>
>   /^\s*sed\s+-i/ and err('sed -i is not portable');
>
> to make the structure of the program (i.e., a list of conditions to
> complain about) clear, but I know not everybody agrees with such a terse
> style.
Thanks for a nicely-done review.
Previous: Jeff KingNext: Torsten Bögershausen
Message 6 of 18 in “test: Add target test-lint-shell-syntax”
  1. 1/4 test: Add target test-lint-shell-syntaxTorsten Bögershausen, Jan 1, 2013
  2. Junio C HamanoJan 1, 2013
  3. Torsten BögershausenJan 2, 2013
  4. Junio C HamanoJan 2, 2013
  5. Jeff KingJan 2, 2013
  6. Junio C HamanoJan 2, 2013
  7. Torsten BögershausenJan 2, 2013
  8. Jeff KingJan 2, 2013
  9. Torsten BögershausenJan 2, 2013
  10. Junio C HamanoJan 3, 2013
  11. Torsten BögershausenJan 3, 2013
  12. Junio C HamanoJan 3, 2013
  13. tests: turn on test-lint by defaultJeff King, Jan 3, 2013
  14. Junio C HamanoJan 3, 2013
  15. Junio C HamanoJan 3, 2013
  16. Torsten BögershausenJan 7, 2013
  17. Junio C HamanoJan 7, 2013
  18. Torsten BögershausenJan 8, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.