From c54b684132620d99e47c171cd7f4653ca04a3b5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20Vajk?= Date: Thu, 24 Apr 2025 10:29:48 +0200 Subject: [PATCH] Apply suggestions from code review - code quality improvements Co-authored-by: Paolo Tranquilli --- misc/pytest/lib/query_suites.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/misc/pytest/lib/query_suites.py b/misc/pytest/lib/query_suites.py index b0b8aea8cf8..fcbb1f16bde 100644 --- a/misc/pytest/lib/query_suites.py +++ b/misc/pytest/lib/query_suites.py @@ -5,18 +5,18 @@ import pytest @pytest.fixture def check_query_suite(codeql, cwd, expected_files, semmle_code_dir): def ret(query_suite): - actual = codeql.resolve.queries(query_suite, _capture=True).strip() + actual = codeql.resolve.queries(query_suite, _capture=True) actual = sorted(actual.splitlines()) actual = [os.path.relpath(q, semmle_code_dir) for q in actual] actual_file_name = query_suite + '.actual' expected_files.add(actual_file_name) - (cwd / actual_file_name).write_text('\n'.join(actual)+'\n') + (cwd / actual_file_name).write_text('\n'.join(actual) + '\n') return ret @pytest.fixture def check_queries_not_included(codeql, cwd, expected_files, semmle_code_dir): def ret(lang_folder_name, query_suites): - all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).strip().splitlines() + all_queries = codeql.resolve.queries(semmle_code_dir / 'ql' / lang_folder_name / 'ql' / 'src', _capture=True).splitlines() included_in_qls = set() for query_suite in query_suites: @@ -26,5 +26,5 @@ def check_queries_not_included(codeql, cwd, expected_files, semmle_code_dir): not_included = [os.path.relpath(q, semmle_code_dir) for q in not_included] not_included_file_name = 'not_included_in_qls.actual' expected_files.add(not_included_file_name) - (cwd / not_included_file_name).write_text('\n'.join(not_included)+'\n') + (cwd / not_included_file_name).write_text('\n'.join(not_included) + '\n') return ret