Skip to content

Commit

Permalink
Add lint step
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jun 26, 2024
1 parent 7b9967f commit 4725b24
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ on:
- 'Makefile'
- 'package'
jobs:
lint:
name: Lint source
runs-on: ubuntu-latest
steps:
- name: Cache shfmt
uses: actions/cache@v3
with:
path: /usr/local/bin/shfmt
key: 43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
- name: Install shfmt
shell: bash
run: |
install_dir=/usr/local/bin
if ! [[ -f "$install_dir"/shfmt ]]; then
shfmt_version=v3.2.1
shfmt_checksum=43439b996942b53dfafa9b6ff084f394555d049c98fb7ec37978f7668b43e1be
sudo curl --location --silent --fail --tlsv1.2 --proto '=https' \
--output "$install_dir"/shfmt \
https://github.com/mvdan/sh/releases/download/"$shfmt_version"/shfmt_"$shfmt_version"_linux_amd64
sha256sum -c <(echo "$shfmt_checksum $install_dir/shfmt") > /dev/null 2>&1
sudo chmod a+x "$install_dir"/shfmt
fi
- uses: actions/checkout@v4
- name: Lint
run: make lint
build:
name: Build and package
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,25 @@ $(BUILD)/package/oxide.tar.gz: $(BUILD)/package/package $(PKG_OBJ)
tests \
oxide.pro \
Makefile

SRC_FILES = $(shell find -name '*.sh' | grep -v shared/sentry)
SRC_FILES += package

lint:
shfmt \
-d\
-s \
-i 4 \
-bn \
-sr \
$(SRC_FILES)

format:
shfmt \
-l \
-w \
-s \
-i 4 \
-bn \
-sr \
$(SRC_FILES)
6 changes: 3 additions & 3 deletions applications/system-service/generate_xml.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh
cd "$(dirname "$0")"
mkdir -p ../../interfaces
p(){
echo "qdbuscpp2xml $1"
qdbuscpp2xml -A "$1" -o ../../interfaces/"$(basename "$1" .h)".xml
p() {
echo "qdbuscpp2xml $1"
qdbuscpp2xml -A "$1" -o ../../interfaces/"$(basename "$1" .h)".xml
}

p dbusservice.h
Expand Down
4 changes: 2 additions & 2 deletions package
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ oxide() {
replaces=(erode tarnish decay corrupt)
conflicts=(erode tarnish decay corrupt)

package(){
package() {
# System service
install -D -m 644 -t "$pkgdir"/etc/dbus-1/system.d "$srcdir"/release/etc/dbus-1/system.d/codes.eeems.oxide.conf
install -D -m 644 -t "$pkgdir"/lib/systemd/system "$srcdir"/release/etc/systemd/system/tarnish.service
Expand All @@ -53,7 +53,7 @@ oxide() {
install -D -m 644 -t "$pkgdir"/opt/usr/share/applications "$srcdir"/release/opt/usr/share/applications/codes.eeems.corrupt.oxide
}

configure(){
configure() {
systemctl daemon-reload
if is-active "tarnish.service"; then
update-desktop-database
Expand Down

0 comments on commit 4725b24

Please sign in to comment.