-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This ports the `lint-desktop-files` CI job from the securedrop-builder repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
lint-desktop: | ||
strategy: | ||
matrix: | ||
debian_version: | ||
- bullseye | ||
- bookworm | ||
runs-on: ubuntu-latest | ||
container: debian:${{ matrix.debian_version }} | ||
steps: | ||
- run: | | ||
apt-get update && apt-get install --yes git make desktop-file-utils | ||
- uses: actions/checkout@v4 | ||
- name: Lint .desktop files | ||
run: | | ||
make lint-desktop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.PHONY: all | ||
all: help | ||
|
||
.PHONY: lint-desktop | ||
lint-desktop: ## Lint .desktop files | ||
find . -name *.desktop -type f -not -path '*/\.git/*' | xargs desktop-file-validate | ||
|
||
|
||
# Explanation of the below shell command should it ever break. | ||
# 1. Set the field separator to ": ##" and any make targets that might appear between : and ## | ||
# 2. Use sed-like syntax to remove the make targets | ||
# 3. Format the split fields into $$1) the target name (in blue) and $$2) the target description | ||
# 4. Pass this file as an arg to awk | ||
# 5. Sort it alphabetically | ||
# 6. Format columns with colon as delimiter. | ||
.PHONY: help | ||
help: ## Print this message and exit. | ||
@printf "Makefile for developing and testing the SecureDrop client.\n" | ||
@printf "Subcommands:\n\n" | ||
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z_-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) \ | ||
| sort \ | ||
| column -s ':' -t |