summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Drozd <nicholasdrozd@gmail.com>2018-01-02 19:24:41 -0600
committerClaudiu Popa <pcmanticore@gmail.com>2018-01-04 08:11:09 +0100
commitb8a617b37d2994703c107ed17a513d39c7b6adc8 (patch)
treebd00edd17e1957f0f16b22dc67f4908eabd382fc
parentaee59b9d8577f2eb60d92accb6b5516eac993e38 (diff)
downloadpylint-git-b8a617b37d2994703c107ed17a513d39c7b6adc8.tar.gz
Enable broad-except check
This was globally disabled, which is not a great idea, and also locally disabled in a few places. I enabled it globally and consolidated the local disables.
-rw-r--r--pylint/lint.py6
-rw-r--r--pylint/reporters/ureports/nodes.py1
-rw-r--r--pylintrc1
3 files changed, 5 insertions, 3 deletions
diff --git a/pylint/lint.py b/pylint/lint.py
index be7fdaa97..75867566e 100644
--- a/pylint/lint.py
+++ b/pylint/lint.py
@@ -33,6 +33,8 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
+# pylint: disable=broad-except
+
""" %prog [options] modules_or_packages
Check that module(s) satisfy a coding standard (and more !).
@@ -946,7 +948,7 @@ class PyLinter(config.OptionsManagerMixIn,
args=str(ex.error))
except astroid.AstroidBuildingException as ex:
self.add_message('parse-error', args=ex)
- except Exception as ex: # pylint: disable=broad-except
+ except Exception as ex:
import traceback
traceback.print_exc()
self.add_message('astroid-error', args=(ex.__class__, ex))
@@ -1032,7 +1034,7 @@ class PyLinter(config.OptionsManagerMixIn,
evaluation = self.config.evaluation
try:
note = eval(evaluation, {}, self.stats) # pylint: disable=eval-used
- except Exception as ex: # pylint: disable=broad-except
+ except Exception as ex:
msg = 'An exception occurred while rating: %s' % ex
else:
self.stats['global_note'] = note
diff --git a/pylint/reporters/ureports/nodes.py b/pylint/reporters/ureports/nodes.py
index 24f87ca89..bc241239b 100644
--- a/pylint/reporters/ureports/nodes.py
+++ b/pylint/reporters/ureports/nodes.py
@@ -40,6 +40,7 @@ class VNode(object):
"""
try:
return self.TYPE.replace('-', '_')
+ # pylint: disable=broad-except
except Exception:
return self.__class__.__name__.lower()
diff --git a/pylintrc b/pylintrc
index 54cadfaeb..3b10bf14f 100644
--- a/pylintrc
+++ b/pylintrc
@@ -54,7 +54,6 @@ confidence=
disable=
attribute-defined-outside-init,
- broad-except,
duplicate-code,
fixme,
import-error,