From f2f8f61e1cc62d2d99710ec7f8261ce305188b46 Mon Sep 17 00:00:00 2001 From: Alexandre Chakroun Date: Mon, 5 Aug 2024 16:56:50 +0200 Subject: [PATCH] Fix formatting --- src/sentry/ownership/grammar.py | 4 +--- tests/sentry/ownership/test_grammar.py | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/sentry/ownership/grammar.py b/src/sentry/ownership/grammar.py index 8332edbc4f236a..0c2bc07435d067 100644 --- a/src/sentry/ownership/grammar.py +++ b/src/sentry/ownership/grammar.py @@ -165,9 +165,7 @@ def test_frames( match_frame_value_func: Callable[[str | None, str], bool] = lambda val, pattern: bool( glob_match(val, pattern, ignorecase=True, path_normalize=True) ), - match_frame_func: Callable[[Sequence[Mapping[str, Any]]], bool] = lambda frame: bool( - True - ), + match_frame_func: Callable[[Sequence[Mapping[str, Any]]], bool] = lambda frame: bool(True), ) -> bool: for frame in (f for f in frames if isinstance(f, Mapping)): if not match_frame_func(frame): diff --git a/tests/sentry/ownership/test_grammar.py b/tests/sentry/ownership/test_grammar.py index 9bc41c71b711dc..a488f5c9b5dabb 100644 --- a/tests/sentry/ownership/test_grammar.py +++ b/tests/sentry/ownership/test_grammar.py @@ -984,9 +984,27 @@ def test_convert_codeowners_syntax_excludes_invalid(): @pytest.mark.parametrize( "path_details, expected", [ - ([{"filename": "foo/test.py", "in_app": False}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": False}], False), - ([{"filename": "foo/test.py", "in_app": True}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}], True), - ([{"filename": "foo/test.py", "in_app": False}, {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}], True), + ( + [ + {"filename": "foo/test.py", "in_app": False}, + {"abs_path": "/usr/local/src/foo/test.py", "in_app": False}, + ], + False, + ), + ( + [ + {"filename": "foo/test.py", "in_app": True}, + {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}, + ], + True, + ), + ( + [ + {"filename": "foo/test.py", "in_app": False}, + {"abs_path": "/usr/local/src/foo/test.py", "in_app": True}, + ], + True, + ), ], ) def test_codeowners_select_in_app_frames_only(path_details, expected):