Ticket #414 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

[BUG] t/codingstd/c_cppcomments.t reports spurious error at hyperlinks

Reported by: jkeenan Owned by:
Priority: minor Milestone:
Component: docs Version: trunk
Severity: low Keywords: cpp codingstd newbie
Cc: Language:
Patch status: Platform: all

Description

The c_cppcomments.t coding standards test is supposed to detect usage of C++-style comments. Unfortunately, the double forward slashes of such comments are also found in hyperlinks that may reasonably appear in POD inside C-ish files.

Suppose we had a file like this named some.ops:

/*$
 * $Id: experimental.ops 37191 2009-03-08 02:37:10Z coke $$
** some.ops$
*/$
$
VERSION = PARROT_VERSION;$
$
=head1 NAME$
$
experimental.ops - Experimental Opcodes$
L<https://trac.parrot.org>$
$
=cut$

... and then we called:

   $ perl t/codingstd/c_cppcomments.t some.ops

... we would get:

1..1
not ok 1 - no c++ comments
#   Failed test 'no c++ comments'
#   at t/codingstd/c_cppcomments.t line 45.
# C++ comments found in the following files:
# some.ops
# That's 1 failed files out of 1 files total.
# Looks like you failed 1 test of 1.

Change History

Changed 5 years ago by coke

Note that this test wouldn't fail on a C file because then the POD would be encapsulated in a C-style comment. OPS apparently are special and have their pod stripped when converted to C.

Since OPS files aren't C, they should probably be excluded from the tests. (and the generated C files checked instead).

However this gets fixed, other standards tests will probably need similar fixes.

Changed 5 years ago by jkeenan

Coke applied a quick fix in r37219 but requests that the ticket be kept open for a more complete solution.

Changed 5 years ago by NotFound

Let's hope nobody write things like:

int a = b ? http:// He!
  other;

Changed 4 years ago by coke

  • owner set to coke

Changed 4 years ago by cotto

  • keywords newbie added

Changed 4 years ago by coke

  • owner coke deleted

Changed 4 years ago by coke

  • status changed from new to closed
  • resolution set to fixed

No big complaints in the 23 months since the quick fix. Closing ticket.

Note: See TracTickets for help on using tickets.