|
1 |
| -################################################################################ |
2 |
| -# # |
3 |
| -# Copyright (C) 2020 Dominic Davis-Foster # |
4 |
| -# Based on pylint # |
5 |
| -# See notebook2script/pointless.py for full copyright information # |
6 |
| -# # |
7 |
| -# This program is free software; you can redistribute it and/or modify # |
8 |
| -# it under the terms of the GNU General Public License version 2 as # |
9 |
| -# published by the Free Software Foundation. # |
10 |
| -# # |
11 |
| -# This program is distributed in the hope that it will be useful, # |
12 |
| -# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
13 |
| -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
14 |
| -# GNU General Public License for more details. # |
15 |
| -# # |
16 |
| -# You should have received a copy of the GNU General Public License # |
17 |
| -# along with this program; if not, write to the Free Software # |
18 |
| -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # |
19 |
| -# # |
20 |
| -################################################################################ |
| 1 | +#!/usr/bin/env python3 |
| 2 | +# |
| 3 | +# base.py |
| 4 | +""" |
| 5 | +Checker for pointless statements. |
| 6 | +""" |
| 7 | +# |
| 8 | +# Copyright © 2020-2021 Dominic Davis-Foster <dominic@davis-foster.co.uk> |
| 9 | +# Based on pylint |
| 10 | +# See notebook2script/pointless.py for full copyright information |
| 11 | +# |
| 12 | +# This program is free software; you can redistribute it and/or modify |
| 13 | +# it under the terms of the GNU General Public License version 2 |
| 14 | +# as published by the Free Software Foundation. |
| 15 | +# |
| 16 | +# This program is distributed in the hope that it will be useful, |
| 17 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | +# GNU General Public License for more details. |
| 20 | +# |
| 21 | +# You should have received a copy of the GNU General Public License |
| 22 | +# along with this program; if not, write to the Free Software |
| 23 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
| 24 | +# MA 02110-1301, USA. |
| 25 | +# |
21 | 26 |
|
22 | 27 | # stdlib
|
23 | 28 | from typing import Dict, Tuple
|
|
33 | 38 | __all__ = ["BasicChecker", "register"]
|
34 | 39 |
|
35 | 40 |
|
36 |
| -class BasicChecker(BaseChecker): |
37 |
| - """checks for : |
38 |
| - * doc strings |
39 |
| - * number of arguments, local variables, branches, returns and statements in |
40 |
| - functions, methods |
41 |
| - * required module attributes |
42 |
| - * dangerous default values as arguments |
43 |
| - * redefinition of function / method / class |
44 |
| - * uses of the global statement |
45 |
| - """ |
| 41 | +class BasicChecker(BaseChecker): # noqa: D101 |
46 | 42 |
|
47 | 43 | __implements__ = interfaces.IAstroidChecker
|
48 | 44 |
|
@@ -118,7 +114,7 @@ def visit_expr(self, node) -> None:
|
118 | 114 |
|
119 | 115 | def register(linter) -> None:
|
120 | 116 | """
|
121 |
| - required method to auto register this checker |
| 117 | + Required function to auto register this checker. |
122 | 118 | """
|
123 | 119 |
|
124 | 120 | linter.register_checker(BasicChecker(linter))
|
0 commit comments