From 455f75a7f45bf431b3f99493b4cb460f21407f74 Mon Sep 17 00:00:00 2001 From: rusty-snake <41237666+rusty-snake@users.noreply.github.com> Date: Sat, 13 Feb 2021 20:52:37 +0100 Subject: sort.py: Print the fixed line when running in a CI --- contrib/sort.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/sort.py') diff --git a/contrib/sort.py b/contrib/sort.py index 921343162..ad5e063ac 100755 --- a/contrib/sort.py +++ b/contrib/sort.py @@ -24,6 +24,7 @@ Exit-Codes: # Requirements: # python >= 3.6 +from os import getenv from sys import argv @@ -80,7 +81,7 @@ def fix_profile(filename): lines = profile.read().split("\n") was_fixed = False fixed_profile = [] - for line in lines: + for lineno, line in enumerate(lines): if line[:12] in ("private-bin ", "private-etc ", "private-lib "): fixed_line = f"{line[:12]}{sort_alphabetical(line[12:])}" elif line[:13] in ("seccomp.drop ", "seccomp.keep "): @@ -95,6 +96,8 @@ def fix_profile(filename): fixed_line = line if fixed_line != line: was_fixed = True + if getenv("CI"): + print(f"{filename}:{lineno + 1}:{fixed_line}") fixed_profile.append(fixed_line) if was_fixed: profile.seek(0) -- cgit v1.2.3-54-g00ecf