Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: third_party/pylint/pylint/interfaces.py

Issue 1920403002: [content/test/gpu] Run pylint check of gpu tests in unittest instead of PRESUBMIT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update path to LICENSE.txt of logilab/README.chromium Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/pylint/pylint/gui.py ('k') | third_party/pylint/pylint/lint.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # This program is free software; you can redistribute it and/or modify it under
2 # the terms of the GNU General Public License as published by the Free Software
3 # Foundation; either version 2 of the License, or (at your option) any later
4 # version.
5 #
6 # This program is distributed in the hope that it will be useful, but WITHOUT
7 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
9 #
10 # You should have received a copy of the GNU General Public License along with
11 # this program; if not, write to the Free Software Foundation, Inc.,
12 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13 """Interfaces for Pylint objects"""
14 from collections import namedtuple
15
16 from logilab.common.interface import Interface
17
18 Confidence = namedtuple('Confidence', ['name', 'description'])
19 # Warning Certainties
20 HIGH = Confidence('HIGH', 'No false positive possible.')
21 INFERENCE = Confidence('INFERENCE', 'Warning based on inference result.')
22 INFERENCE_FAILURE = Confidence('INFERENCE_FAILURE',
23 'Warning based on inference with failures.')
24 UNDEFINED = Confidence('UNDEFINED',
25 'Warning without any associated confidence level.')
26
27 CONFIDENCE_LEVELS = [HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED]
28
29
30 class IChecker(Interface):
31 """This is an base interface, not designed to be used elsewhere than for
32 sub interfaces definition.
33 """
34
35 def open(self):
36 """called before visiting project (i.e set of modules)"""
37
38 def close(self):
39 """called after visiting project (i.e set of modules)"""
40
41
42 class IRawChecker(IChecker):
43 """interface for checker which need to parse the raw file
44 """
45
46 def process_module(self, astroid):
47 """ process a module
48
49 the module's content is accessible via astroid.stream
50 """
51
52
53 class ITokenChecker(IChecker):
54 """Interface for checkers that need access to the token list."""
55 def process_tokens(self, tokens):
56 """Process a module.
57
58 tokens is a list of all source code tokens in the file.
59 """
60
61
62 class IAstroidChecker(IChecker):
63 """ interface for checker which prefers receive events according to
64 statement type
65 """
66
67
68 class IReporter(Interface):
69 """ reporter collect messages and display results encapsulated in a layout
70 """
71 def add_message(self, msg_id, location, msg):
72 """add a message of a given type
73
74 msg_id is a message identifier
75 location is a 3-uple (module, object, line)
76 msg is the actual message
77 """
78
79 def display_results(self, layout):
80 """display results encapsulated in the layout tree
81 """
82
83
84 __all__ = ('IRawChecker', 'IAstroidChecker', 'ITokenChecker', 'IReporter')
OLDNEW
« no previous file with comments | « third_party/pylint/pylint/gui.py ('k') | third_party/pylint/pylint/lint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698