summaryrefslogtreecommitdiff
path: root/tests/input
diff options
context:
space:
mode:
authorsyutbai <syutbai@gmail.com>2019-11-21 03:07:25 -0500
committerClaudiu Popa <pcmanticore@gmail.com>2019-11-21 09:07:25 +0100
commit16017690196e77fcabdedf1cd8b8cbfb357a97d4 (patch)
tree846a0501e8a7f914324ffbdd70690d876631acad /tests/input
parent092038516bb8ed9b4026b93a5ae1fd1070c6cf48 (diff)
downloadpylint-git-16017690196e77fcabdedf1cd8b8cbfb357a97d4.tar.gz
Add support for --fail-under flag
Add a --fail-under <score> flag, also configurable in a `.pylintrc`file If the final score is more than the specified score, it's considered a success and pylint exits with exit code 0. Otherwise, it's considered a failure and pylint exits with its current exit code based on the messages issued. Close #2242
Diffstat (limited to 'tests/input')
-rw-r--r--tests/input/fail_under_minus6.py16
-rw-r--r--tests/input/fail_under_plus6.py8
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/input/fail_under_minus6.py b/tests/input/fail_under_minus6.py
new file mode 100644
index 000000000..7984ffd1b
--- /dev/null
+++ b/tests/input/fail_under_minus6.py
@@ -0,0 +1,16 @@
+"""
+ Pylint score: -6
+"""
+import os
+
+import nonexistent
+
+
+def loop():
+ count = 0
+ for i in range(5):
+ count += 1
+ print(count)
+
+path = '/tmp'
+os.path.exists(path)
diff --git a/tests/input/fail_under_plus6.py b/tests/input/fail_under_plus6.py
new file mode 100644
index 000000000..640088a3d
--- /dev/null
+++ b/tests/input/fail_under_plus6.py
@@ -0,0 +1,8 @@
+""""
+ pylint score: +6
+"""
+
+import os
+
+path = '/tmp'
+os.path.exists(path)