forked from coala/coala-bears
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLintBear.py
31 lines (27 loc) · 1.04 KB
/
CMakeLintBear.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.PipRequirement import PipRequirement
from coalib.settings.Setting import path
@linter(executable='cmakelint',
output_format='regex',
output_regex=r'.+:(?P<line>\d+): (?P<message>.*)')
class CMakeLintBear:
"""
Check CMake code for syntactical or formatting issues.
For more information consult <https://github.com/richq/cmake-lint>.
"""
LANGUAGES = {'CMake'}
REQUIREMENTS = {PipRequirement('cmakelint', '1.3')}
AUTHORS = {'The coala developers'}
AUTHORS_EMAILS = {'[email protected]'}
LICENSE = 'AGPL-3.0'
CAN_DETECT = {'Syntax', 'Formatting'}
@staticmethod
def create_arguments(filename, file, config_file,
cmakelint_config: path=''):
"""
:param cmakelint_config: The location of the cmakelintrc config file.
"""
args = ()
if cmakelint_config:
args += ('--config=' + cmakelint_config,)
return args + (filename,)