~widelands-dev/widelands/bug-1654989-fuzzy-terrain-images

« back to all changes in this revision

Viewing changes to cmake/codecheck/rules/illegal_space_before

  • 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 space before a closing grouping token (bracket, brace or
 
6
parenthesis), semicolon or comma. Characters inside "" and after // are
 
7
ignored.
 
8
"""
 
9
 
 
10
error_msg = "No space before ), }, ; allowed!"
 
11
 
 
12
regexp = r"""^([^/#"']|/([^/"']|"([^"]|\\")*"|'(\\[\'0nt]|[^\'])')|"([^"\]|\\"|\\[^"])*"|'(\\[\'0nt]|[^\'])')*/? []);,]"""
 
13
 
 
14
forbidden = [
 
15
    ' )',
 
16
    '   / )',
 
17
    '; ;',
 
18
]
 
19
 
 
20
allowed = [
 
21
    '// }',
 
22
    '// )',
 
23
    '   // )',
 
24
    '" )"',
 
25
    '" \")"',
 
26
    '    " \")"',
 
27
]