From a5e83651b1eed2bba2f5c01071f644167b4ec708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geoffrey=20Leh=C3=A9e?= Date: Tue, 21 Mar 2017 19:22:14 +0100 Subject: [PATCH] Remove new trailing line and empty value --- lint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lint.py b/lint.py index 272a9d9..f2ef778 100644 --- a/lint.py +++ b/lint.py @@ -180,7 +180,10 @@ def load_flake8_config(filename, global_config=False, project_config=False): if option_type == 'list': option_value = parser.get('flake8', config).strip() if option_value: - result[plugin] = option_value.split(',') + result[plugin] = [v.replace( + '\n', '') for v in option_value.split(',')] + if result[plugin] and not result[plugin][-1]: + del result[plugin][-1] elif option_type == 'int': option_value = parser.get('flake8', config).strip() if option_value: