OLD | NEW |
1 # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). | 1 # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). |
2 # This program is free software; you can redistribute it and/or modify it under | 2 # This program is free software; you can redistribute it and/or modify it under |
3 # the terms of the GNU General Public License as published by the Free Software | 3 # the terms of the GNU General Public License as published by the Free Software |
4 # Foundation; either version 2 of the License, or (at your option) any later | 4 # Foundation; either version 2 of the License, or (at your option) any later |
5 # version. | 5 # version. |
6 # | 6 # |
7 # This program is distributed in the hope that it will be useful, but WITHOUT | 7 # This program is distributed in the hope that it will be useful, but WITHOUT |
8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
9 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | 9 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
10 # | 10 # |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 """a reporter very similar to TextReporter, but display messages in a form | 70 """a reporter very similar to TextReporter, but display messages in a form |
71 recognized by most text editors : | 71 recognized by most text editors : |
72 | 72 |
73 <filename>:<linenum>:<msg> | 73 <filename>:<linenum>:<msg> |
74 """ | 74 """ |
75 name = 'parseable' | 75 name = 'parseable' |
76 line_format = '{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' | 76 line_format = '{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' |
77 | 77 |
78 def __init__(self, output=None): | 78 def __init__(self, output=None): |
79 warnings.warn('%s output format is deprecated. This is equivalent ' | 79 warnings.warn('%s output format is deprecated. This is equivalent ' |
80 'to --msg-template=%s' % (self.name, self.line_format)) | 80 'to --msg-template=%s' % (self.name, self.line_format), |
| 81 DeprecationWarning) |
81 TextReporter.__init__(self, output) | 82 TextReporter.__init__(self, output) |
82 | 83 |
83 | 84 |
84 class VSTextReporter(ParseableTextReporter): | 85 class VSTextReporter(ParseableTextReporter): |
85 """Visual studio text reporter""" | 86 """Visual studio text reporter""" |
86 name = 'msvs' | 87 name = 'msvs' |
87 line_format = '{path}({line}): [{msg_id}({symbol}){obj}] {msg}' | 88 line_format = '{path}({line}): [{msg_id}({symbol}){obj}] {msg}' |
88 | 89 |
89 | 90 |
90 class ColorizedTextReporter(TextReporter): | 91 class ColorizedTextReporter(TextReporter): |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 for attr in ('msg', 'symbol', 'category', 'C')}) | 137 for attr in ('msg', 'symbol', 'category', 'C')}) |
137 self.write_message(msg) | 138 self.write_message(msg) |
138 | 139 |
139 | 140 |
140 def register(linter): | 141 def register(linter): |
141 """Register the reporter classes with the linter.""" | 142 """Register the reporter classes with the linter.""" |
142 linter.register_reporter(TextReporter) | 143 linter.register_reporter(TextReporter) |
143 linter.register_reporter(ParseableTextReporter) | 144 linter.register_reporter(ParseableTextReporter) |
144 linter.register_reporter(VSTextReporter) | 145 linter.register_reporter(VSTextReporter) |
145 linter.register_reporter(ColorizedTextReporter) | 146 linter.register_reporter(ColorizedTextReporter) |
OLD | NEW |