~widelands-dev/widelands/bug-1808169-disable-focus

« back to all changes in this revision

Viewing changes to cmake/codecheck/rules/explicit_this_dereference_and_component_selection

  • 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 is something that should be caught before it reaches Nicolai's eyes. The
 
6
explicit use of "this->" is not allowed. But it should not catch things like
 
7
"do_this->now". It should also not catch things like
 
8
"(this->*(action->function))(g, state, action)", which seem to be needed in
 
9
some places.
 
10
"""
 
11
 
 
12
error_msg = "Do not use this->m_a, use m_a instead."
 
13
 
 
14
regexp=r"""(?:^|[^_a-zA-Z0-9])this *-> *[^*]"""
 
15
 
 
16
forbidden = [
 
17
    'this->m_b',
 
18
    '    this->m_b',
 
19
    '    this  ->   m_b',
 
20
]
 
21
 
 
22
allowed = [
 
23
    'm_b',
 
24
    'gthis->m_b',
 
25
    '(this->*(action->function))(g, state, action)',
 
26
]