Failed Conditions
Pull Request — master (#1814)
by Mischa
01:29
created

coalib.bearlib.abstractions.DefaultLinterInterface   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %
Metric Value
wmc 2
dl 0
loc 39
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A generate_config() 0 19 1
A create_arguments() 0 17 1
1
class DefaultLinterInterface:
2
3
    @staticmethod
4
    def generate_config(filename, file):
5
        """
6
        Generates the content of a config-file the linter-tool might need.
7
8
        The contents generated from this function are written to a temporary
9
        file and the path is provided inside ``create_arguments()``.
10
11
        By default no configuration is generated.
12
13
        You can provide additional keyword arguments and defaults. These will
14
        be interpreted as required settings that need to be provided through a
15
        coafile-section.
16
17
        :param filename: The name of the file currently processed.
18
        :param file:     The contents of the file currently processed.
19
        :return:         The config-file-contents as a string or ``None``.
20
        """
21
        return None
22
23
    @staticmethod
24
    def create_arguments(filename, file, config_file):
25
        """
26
        Creates the arguments for the linter.
27
28
        You can provide additional keyword arguments and defaults. These will
29
        be interpreted as required settings that need to be provided through a
30
        coafile-section.
31
32
        :param filename:    The name of the file the linter-tool shall process.
33
        :param file:        The contents of the file.
34
        :param config_file: The path of the config-file if used. ``None`` if
35
                            unused.
36
        :return:            A sequence of arguments to feed the linter-tool
37
                            with.
38
        """
39
        raise NotImplementedError
40