From d68f531c24ff21713a87ca83882619648d51d1c8 Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Mon, 23 Sep 2024 23:39:04 +0200 Subject: [PATCH] Add debug traces to investigate reporters activation (#4025) * Add debug traces to investigate reporters activation Related to https://github.com/oxsecurity/megalinter/issues/3913 * Fix * fix * [MegaLinter] Apply linters fixes --------- Co-authored-by: nvuillam --- CHANGELOG.md | 1 + megalinter/utils.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 196f7c8e66b..196c1b97545 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Linters enhancements - Fixes + - Add debug traces to investigate reporters activation - Reporters diff --git a/megalinter/utils.py b/megalinter/utils.py index ff1dd5c61fd..ed25c082b30 100644 --- a/megalinter/utils.py +++ b/megalinter/utils.py @@ -244,6 +244,10 @@ def list_active_reporters_for_scope(scope, reporter_init_params): if reporter_class.scope == scope: reporter = reporter_class(reporter_init_params) scope_reporters += [reporter] + logging.debug( + f"[Reporters] Available reporters for scope {scope}: " + + ",".join([obj.name for obj in scope_reporters]) + ) # Keep only active reporters for reporter in scope_reporters: if reporter.is_active is False: @@ -251,6 +255,10 @@ def list_active_reporters_for_scope(scope, reporter_init_params): reporters += [reporter] # Sort reporters by name reporters = sorted(reporters, key=lambda r: r.processing_order) + logging.debug( + f"[Reporters] Active reporters for scope {scope}: " + + ",".join([obj.name for obj in reporters]) + ) return reporters