~widelands-dev/widelands/bug-1803602-reveal-frisian-campaign

« back to all changes in this revision

Viewing changes to cmake/codecheck/rules/missing_space_after_comma

  • Committer: qcs
  • Date: 2010-02-05 01:13:20 UTC
  • Revision ID: git-v1:136d6c48811c97ec1f98301726134b0de66f868c
Manual merge of cmake-migration branch to trunk

git-svn-id: https://widelands.svn.sourceforge.net/svnroot/widelands/trunk@5030 37b2a8de-5219-0410-9f54-a31bc463ab9c

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
 
 
4
"""
 
5
This catches a comma that is followed by another character than a space, for
 
6
example "a,b,c", which should be "a, b, c". It is a little complex because it
 
7
should not catch commas in string constants or character constants.
 
8
"""
 
9
 
 
10
error_msg = "A space is mandatory after ','."
 
11
 
 
12
strip_comments_and_strings = True
 
13
regexp = r""",[^\s]"""
 
14
 
 
15
 
 
16
forbidden = [
 
17
    "do_something('\t','u')",
 
18
    'do_something("\t","u")',
 
19
 
 
20
    # Eriks tests
 
21
    ## missing_space_after_comma.cc
 
22
    "float __,_,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;",
 
23
    "float ____,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z;",
 
24
    "float XX = ff(_,0,1,2,3,4);",
 
25
    "float YY = ff(_,5,6,7,8,9);",
 
26
]
 
27
 
 
28
allowed = [
 
29
    '''do_something(",", ',')''',
 
30
    '/* We,are inside a comment,*/',
 
31
    '// This is,a comment too',
 
32
 
 
33
    # Eriks tests
 
34
    ## missing_space_after_comma.cc
 
35
    'float ff(float, float, float, float, float, float);',
 
36
]