From 466092cdac4e94c85107071e09869317ea10e48c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 30 Dec 2021 14:03:49 +0000 Subject: [PATCH] Check if source code contains tabs --- tests.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests.py b/tests.py index 411b32332..851e0abc8 100644 --- a/tests.py +++ b/tests.py @@ -4543,6 +4543,27 @@ def _test_config_param_names(): break +def _test_source_contains_no_tabs(): + print('testSourceContainsNoTabs') + + for subdir, dirs, files in os.walk('.'): + for source_file in files: + if not source_file.endswith('.py'): + continue + if source_file.startswith('.#'): + continue + if source_file.startswith('flycheck_'): + continue + source_str = '' + with open(source_file, 'r') as file_source: + source_str = file_source.read() + if not source_str: + continue + if '\t' in source_str: + print(source_file + ' contains tabs') + assert False + + def _test_checkbox_names(): print('testCheckboxNames') @@ -6276,6 +6297,7 @@ def run_all_tests(): base_dir = os.getcwd() print('Running tests...') update_default_themes_list(os.getcwd()) + _test_source_contains_no_tabs() _translate_ontology(base_dir) _test_get_price_from_string() _test_post_variable_names()