Source code

Revision control

Other Tools

1
---
2
cpp-virtual-final:
3
description: "Virtual function declarations should specify only one of
4
`virtual`, `final`, or `override`"
5
level: error
6
include: ['.']
7
extensions: ['cc', 'cpp', 'h', 'mm']
8
type: regex
9
#
10
# This lint warns about:
11
#
12
# virtual void Bad1() final
13
# void Bad2() final override
14
# void Bad3() override final
15
#
16
# Caveats: This lint ...
17
#
18
# * Doesn't warn about `virtual void NotBad() override` at this time
19
# because there are currently 6963 instances of this pattern.
20
#
21
# * Doesn't warn about function declarations that span multiple lines
22
# because the regex can't match across line breaks.
23
#
24
# virtual ) final | final override | override final
25
payload: ^ *virtual .+\).+\bfinal\b|\bfinal +override\b|\boverride +final\b