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

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

Issue 10447014: Add pylint to depot_tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Fix unittests. Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « third_party/pylint/gui.py ('k') | third_party/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 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
13 """ Copyright (c) 2002-2003 LOGILAB S.A. (Paris, FRANCE).
14 http://www.logilab.fr/ -- mailto:contact@logilab.fr
15
16 Interfaces for PyLint objects
17 """
18
19 __revision__ = "$Id: interfaces.py,v 1.9 2004-04-24 12:14:53 syt Exp $"
20
21 from logilab.common.interface import Interface
22
23
24 class IChecker(Interface):
25 """This is an base interface, not designed to be used elsewhere than for
26 sub interfaces definition.
27 """
28
29 def open(self):
30 """called before visiting project (i.e set of modules)"""
31
32 def close(self):
33 """called after visiting project (i.e set of modules)"""
34
35 ## def open_module(self):
36 ## """called before visiting a module"""
37
38 ## def close_module(self):
39 ## """called after visiting a module"""
40
41
42 class IRawChecker(IChecker):
43 """interface for checker which need to parse the raw file
44 """
45
46 def process_module(self, astng):
47 """ process a module
48
49 the module's content is accessible via astng.file_stream
50 """
51
52
53 class IASTNGChecker(IChecker):
54 """ interface for checker which prefers receive events according to
55 statement type
56 """
57
58
59 class ILinter(Interface):
60 """interface for the linter class
61
62 the linter class will generate events to its registered checkers.
63 Each checker may interact with the linter instance using this API
64 """
65
66 def register_checker(self, checker):
67 """register a new checker class
68
69 checker is a class implementing IrawChecker or / and IASTNGChecker
70 """
71
72 def add_message(self, msg_id, line=None, node=None, args=None):
73 """add the message corresponding to the given id.
74
75 If provided, msg is expanded using args
76
77 astng checkers should provide the node argument,
78 raw checkers should provide the line argument.
79 """
80
81
82 class IReporter(Interface):
83 """ reporter collect messages and display results encapsulated in a layout
84 """
85 def add_message(self, msg_id, location, msg):
86 """add a message of a given type
87
88 msg_id is a message identifier
89 location is a 3-uple (module, object, line)
90 msg is the actual message
91 """
92
93 def display_results(self, layout):
94 """display results encapsulated in the layout tree
95 """
96
97
98 __all__ = ('IRawChecker', 'IStatable', 'ILinter', 'IReporter')
OLDNEW
« no previous file with comments | « third_party/pylint/gui.py ('k') | third_party/pylint/lint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698