File: do_not_use_private_inheritance.py

package info (click to toggle)
widelands 2%3A1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 600,516 kB
  • sloc: cpp: 166,473; ansic: 18,683; python: 7,697; sh: 1,363; xml: 467; makefile: 45
file content (16 lines) | stat: -rw-r--r-- 306 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/python

error_msg = 'Do not use private inheritance. Favor composition instead.'

strip_comments_and_strings = True
regexp = r':.*private '

allowed = [
    'y = private palu',
    ' class Foo : public A',
]

forbidden = [
    ' class Foo : private A',
    ' class Foo : public A, private B',
]