From 01bf80de1326f2953e5a8d263b5d134d5e9b52cf Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 21 Feb 2024 09:25:08 -0800 Subject: [PATCH] cosmetic output fixes --- semantic-conventions/src/opentelemetry/semconv/main.py | 7 ++++--- .../src/opentelemetry/semconv/templating/compatibility.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/semantic-conventions/src/opentelemetry/semconv/main.py b/semantic-conventions/src/opentelemetry/semconv/main.py index d3b84ee1..6d792e0e 100644 --- a/semantic-conventions/src/opentelemetry/semconv/main.py +++ b/semantic-conventions/src/opentelemetry/semconv/main.py @@ -108,10 +108,11 @@ def check_compatibility(semconv, args, parser): compatibility_checker = CompatibilityChecker(semconv, prev_semconv) problems = compatibility_checker.check() - if problems: + if any(problems): print(f"Found {len(problems)} compatibility issues:") - for problem in problems: - print(f"\t {problem}") + problems_str = [str(p) for p in problems] + for problem in sorted(problems_str): + print(f"\t{problem}") if not args.ignore_warnings or ( args.ignore_warnings and any(problem.critical for problem in problems) diff --git a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py index f5ea0bb3..d1d4ee45 100644 --- a/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py +++ b/semantic-conventions/src/opentelemetry/semconv/templating/compatibility.py @@ -24,7 +24,7 @@ def __init__(self, signal: str, name: str, message: str, critical: bool = True): self.critical = critical def __str__(self): - return f"\t {self.signal} '{self.name}': {self.message}" + return f"{self.signal} '{self.name}' {self.message}" def __eq__(self, other): if isinstance(other, self.__class__):