Patchwork [1,of,2] check-code: no-check-code must be after a comment sign and a space

login
register
mail settings
Submitter Simon Heimberg
Date Nov. 11, 2013, 11:40 p.m.
Message ID <82010fa54edb068ccd57.1384213210@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/2912/
State Superseded
Headers show

Comments

Simon Heimberg - Nov. 11, 2013, 11:40 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1383988925 -3600
#      Sat Nov 09 10:22:05 2013 +0100
# Node ID 82010fa54edb068ccd57373ab65fc9517d20b0d1
# Parent  93e5a876c2ff2095c07944aaf3426b509eb498f5
check-code: no-check-code must be after a comment sign and a space

This is the format currently used everywhere.
Augie Fackler - Nov. 12, 2013, 7:28 p.m.
On Tue, Nov 12, 2013 at 12:40:10AM +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1383988925 -3600
> #      Sat Nov 09 10:22:05 2013 +0100
> # Node ID 82010fa54edb068ccd57373ab65fc9517d20b0d1
> # Parent  93e5a876c2ff2095c07944aaf3426b509eb498f5
> check-code: no-check-code must be after a comment sign and a space
>
> This is the format currently used everywhere.
>
> diff -r 93e5a876c2ff -r 82010fa54edb contrib/check-code.py
> --- a/contrib/check-code.py	Sat Nov 09 10:21:20 2013 +0100
> +++ b/contrib/check-code.py	Sat Nov 09 10:22:05 2013 +0100
> @@ -443,7 +443,7 @@
>              continue
>          pre = post = fp.read()
>          fp.close()
> -        if "no-" "check-code" in pre:
> +        if "# no-" "check-code" in pre:

Does check-code currently work on files that don't use # for comments?

Could we instead have a test-check-code test that'd grep for
'no-check-code' in a .t file? Would that be an easier check?

>              if debug:
>                  print "Skipping %s for %s it has no-" "check-code" % (
>                         name, f)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r 93e5a876c2ff -r 82010fa54edb contrib/check-code.py
--- a/contrib/check-code.py	Sat Nov 09 10:21:20 2013 +0100
+++ b/contrib/check-code.py	Sat Nov 09 10:22:05 2013 +0100
@@ -443,7 +443,7 @@ 
             continue
         pre = post = fp.read()
         fp.close()
-        if "no-" "check-code" in pre:
+        if "# no-" "check-code" in pre:
             if debug:
                 print "Skipping %s for %s it has no-" "check-code" % (
                        name, f)