Skip to content

Commit

Permalink
Add debug traces to investigate reporters activation (#4025)
Browse files Browse the repository at this point in the history
* Add debug traces to investigate reporters activation

Related to #3913

* Fix

* fix

* [MegaLinter] Apply linters fixes

---------

Co-authored-by: nvuillam <[email protected]>
  • Loading branch information
nvuillam and nvuillam authored Sep 23, 2024
1 parent a9b2e42 commit d68f531
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions megalinter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,21 @@ 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:
continue
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


Expand Down

0 comments on commit d68f531

Please sign in to comment.