Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: sort.py: fix whitespace in entire profile #6593

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/check-profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
- name: sort.py
run: >
./ci/check/profiles/sort.py
etc/inc/*.inc etc/{profile-a-l,profile-m-z}/*.profile
etc/inc/*.inc etc/{profile-a-l,profile-m-z}/*.profile;
echo;
git diff --exit-code
# Currently broken (see #5610)
# - name: private-etc-always-required.sh
# run: >
Expand Down
11 changes: 10 additions & 1 deletion contrib/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,20 @@ def check_profile(filename, overwrite):
)
fixed_profile.append(line)

fixed_profile_str = "\n".join(fixed_profile)
stripped_profile_str = fixed_profile_str.strip() + "\n"
while "\n\n\n" in stripped_profile_str:
stripped_profile_str = stripped_profile_str.replace("\n\n\n", "\n\n")

if stripped_profile_str != fixed_profile_str:
was_fixed = True
print(f"{filename}:(fixed whitespace)")

if was_fixed:
if overwrite:
profile.seek(0)
profile.truncate()
profile.write("\n".join(fixed_profile))
profile.write(stripped_profile_str)
profile.flush()
print(f"[ Fixed ] {filename}")
return 101
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/devhelp.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include devhelp.local
# Persistent global definitions
include globals.local


include disable-common.inc
include disable-devel.inc
include disable-exec.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/display-im6.q16.profile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ include display-im6.q16.local
# Persistent global definitions
include globals.local


# Redirect
include display.profile
1 change: 0 additions & 1 deletion etc/profile-a-l/empathy.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include empathy.local
# Persistent global definitions
include globals.local


include disable-common.inc
include disable-devel.inc
include disable-interpreters.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/gnome-font-viewer.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include gnome-font-viewer.local
# Persistent global definitions
include globals.local


include disable-common.inc
include disable-devel.inc
include disable-exec.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/gnome-recipes.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include gnome-recipes.local
# Persistent global definitions
include globals.local


noblacklist ${HOME}/.cache/gnome-recipes
noblacklist ${HOME}/.local/share/gnome-recipes

Expand Down
1 change: 0 additions & 1 deletion etc/profile-a-l/godot.profile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ protocol unix,inet,inet6,netlink
seccomp
tracelog


#private-bin godot
private-cache
private-dev
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/quassel.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include quassel.local
# Persistent global definitions
include globals.local


include disable-common.inc
include disable-devel.inc
include disable-interpreters.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/rtorrent.profile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ include rtorrent.local
# Persistent global definitions
include globals.local


include disable-common.inc
include disable-devel.inc
include disable-interpreters.inc
Expand Down
1 change: 0 additions & 1 deletion etc/profile-m-z/silentarmy.profile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ include silentarmy.local
# Persistent global definitions
include globals.local


include disable-common.inc
#include disable-devel.inc
include disable-exec.inc
Expand Down
Loading