Skip to content

Commit f0bcbbb

Browse files
committed
implemeneted adherence to REUSE across the codebase
1 parent 23bc9d6 commit f0bcbbb

28 files changed

+1038
-907
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ ARG NIM_VERSION=2.2.6
1616
ARG NIMLANGSERVER_VERSION=1.12.0
1717
ARG ZIG_VERSION=0.15.2
1818
ARG RISCSTAR_VERSION=15.2-r1
19+
ARG UV_VERSION=0.9.24
1920

2021
# Environment variables
2122
ENV NIM_VERSION=${NIM_VERSION}
2223
ENV ZIG_VERSION=${ZIG_VERSION}
2324
ENV RISCSTAR_VERSION=${RISCSTAR_VERSION}
24-
ENV PATH="/home/vscode/riscv64-toolchain/bin:/home/vscode/nim-${NIM_VERSION}/bin:/home/vscode/.nimble/bin:/home/vscode/zig:${PATH}"
25+
ENV UV_VERSION=${UV_VERSION}
26+
ENV PATH="/home/vscode/.local/bin:/home/vscode/riscv64-toolchain/bin:/home/vscode/nim-${NIM_VERSION}/bin:/home/vscode/.nimble/bin:/home/vscode/zig:${PATH}"
2527
ENV SHELL=/bin/zsh
2628

2729
# Install system dependencies
@@ -54,8 +56,25 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5456
xz-utils \
5557
zstd \
5658
git \
59+
# Shell script linting and formatting
60+
shellcheck \
61+
shfmt \
5762
# File watching (for just watch commands)
5863
entr \
64+
# Python runtime (works with uv for package management)
65+
python3 \
66+
python3-venv \
67+
# JSON processing
68+
jq \
69+
# Modern CLI utilities (Claude Code benefits from these)
70+
ripgrep \
71+
fd-find \
72+
tree \
73+
htop \
74+
ncdu \
75+
tmux \
76+
bat \
77+
fzf \
5978
# Clean up
6079
&& apt-get clean \
6180
&& rm -rf /var/lib/apt/lists/* \
@@ -133,9 +152,14 @@ RUN ln -s ~/nim-${NIM_VERSION} ~/nim
133152
# Install zigcc (Nim wrapper for zig cc)
134153
RUN $HOME/nim-${NIM_VERSION}/bin/nimble install -y zigcc
135154

155+
# Install uv (Python package manager)
156+
RUN echo "Installing uv ${UV_VERSION}..." \
157+
&& curl -LsSf "https://astral.sh/uv/${UV_VERSION}/install.sh" | sh \
158+
&& echo "uv ${UV_VERSION} installed successfully"
159+
136160
# Verify installation
137161
RUN nim --version && nimble --version && zig version && zigcc --version \
138-
&& riscv64-none-linux-musl-gcc --version
162+
&& riscv64-none-linux-musl-gcc --version && uv --version
139163

140164
# Reset to root for devcontainer features
141165
USER root

.devcontainer/devcontainer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"NPH_VERSION": "0.6.2",
88
"NIMLANGSERVER_VERSION": "1.12.0",
99
"ZIG_VERSION": "0.15.2",
10-
"RISCSTAR_VERSION": "15.2-r1"
10+
"RISCSTAR_VERSION": "15.2-r1",
11+
"UV_VERSION": "0.9.24"
1112
}
1213
},
1314
"workspaceFolder": "/workspaces/yabb",
@@ -67,6 +68,7 @@
6768
"NIMLANGSERVER_VERSION": "1.12.0",
6869
"ZIG_VERSION": "0.15.2",
6970
"RISCSTAR_VERSION": "15.2-r1",
71+
"UV_VERSION": "0.9.24",
7072
"EDITOR": "code --wait",
7173
"VISUAL": "code --wait"
7274
},
@@ -102,7 +104,10 @@
102104
"timonwong.shellcheck",
103105
"foxundermoon.shell-format",
104106

105-
"redhat.vscode-yaml"
107+
"redhat.vscode-yaml",
108+
109+
"ms-python.python",
110+
"charliermarsh.ruff"
106111
],
107112
"settings": {
108113
"nim.provider": "lsp",

.devcontainer/post-create.sh

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ alias jc='just check'
6060
6161
# CI shortcuts (via just)
6262
alias jci='just ci'
63+
alias jreuse='just reuse'
6364
6465
# Development shortcuts (via just)
6566
alias jr='just run'
@@ -108,6 +109,7 @@ yabbhelp() {
108109
echo " jf - just fmt (format with nph)"
109110
echo " jfc - just fmt-check (CI-friendly)"
110111
echo " jc - just check (fmt-check + lint)"
112+
echo " jreuse - just reuse (REUSE compliance)"
111113
echo " jci - just ci (full pipeline)"
112114
echo ""
113115
echo "Development:"
@@ -123,6 +125,23 @@ yabbhelp() {
123125
}
124126
EOF
125127

128+
# uv shell completions (zsh)
129+
echo 'eval "$(uv generate-shell-completion zsh)"' >> ~/.zshrc
130+
echo 'eval "$(uvx --generate-shell-completion zsh)"' >> ~/.zshrc
131+
132+
# Aliases for Debian package naming quirks
133+
echo "alias fd='fdfind'" >> ~/.zshrc
134+
echo "alias bat='batcat'" >> ~/.zshrc
135+
136+
# fzf key bindings and completion (zsh)
137+
echo 'source /usr/share/doc/fzf/examples/key-bindings.zsh' >> ~/.zshrc
138+
echo 'source /usr/share/doc/fzf/examples/completion.zsh' >> ~/.zshrc
139+
140+
# Install Python tools via uv
141+
echo ""
142+
echo "Installing Python tools via uv..."
143+
uv tool install reuse
144+
126145
# Run setup via just (installs tools + dependencies)
127146
echo ""
128147
echo "Running just setup..."
@@ -176,14 +195,31 @@ if [ -f versions.env ]; then
176195
MISMATCH=1
177196
fi
178197

198+
# Validate uv
199+
INSTALLED_UV=$(uv --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
200+
echo "Checking uv: expected=$UV_VERSION, installed=$INSTALLED_UV"
201+
if [ "$UV_VERSION" != "$INSTALLED_UV" ]; then
202+
echo " WARNING: uv version mismatch!"
203+
MISMATCH=1
204+
fi
205+
206+
# Validate reuse (installed via uv tool)
207+
if command -v reuse &> /dev/null; then
208+
INSTALLED_REUSE=$(reuse --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "unknown")
209+
echo "Checking reuse: installed ($INSTALLED_REUSE)"
210+
else
211+
echo " WARNING: reuse not found! Run 'uv tool install reuse'"
212+
MISMATCH=1
213+
fi
214+
179215
if [ "$MISMATCH" -eq 1 ]; then
180216
echo ""
181217
echo "========================================"
182218
echo "WARNING: Version mismatch detected!"
183219
echo "========================================"
184220
echo "To fix: Update .devcontainer/devcontainer.json"
185-
echo " - build.args (NIM_VERSION, ZIG_VERSION)"
186-
echo " - containerEnv (NIM_VERSION, ZIG_VERSION)"
221+
echo " - build.args (NIM_VERSION, ZIG_VERSION, UV_VERSION)"
222+
echo " - containerEnv (NIM_VERSION, ZIG_VERSION, UV_VERSION)"
187223
echo "Then rebuild the container."
188224
echo "========================================"
189225
else

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ on:
1515
branches: [main]
1616

1717
jobs:
18+
reuse:
19+
name: REUSE Compliance
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: REUSE Compliance Check
26+
uses: fsfe/reuse-action@v6
27+
1828
ci:
1929
name: Format, Lint, Test
2030
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,15 @@ jobs:
410410
cp completions/yabb.fish "${ARCHIVE_NAME}/shell_completions/"
411411
cp completions/yabb.zsh "${ARCHIVE_NAME}/shell_completions/"
412412
413-
# Create scripts directory and copy scripts
413+
# Create scripts directory and copy installer script
414414
mkdir -p "${ARCHIVE_NAME}/scripts"
415415
cp scripts/setup-yabb.sh "${ARCHIVE_NAME}/scripts/"
416416
chmod +x "${ARCHIVE_NAME}/scripts/setup-yabb.sh"
417-
cp scripts/yabb.service "${ARCHIVE_NAME}/scripts/"
418-
cp scripts/yabb.timer "${ARCHIVE_NAME}/scripts/"
417+
418+
# Copy systemd files to config directory
419+
mkdir -p "${ARCHIVE_NAME}/config"
420+
cp config/yabb.service "${ARCHIVE_NAME}/config/"
421+
cp config/yabb.timer "${ARCHIVE_NAME}/config/"
419422
420423
# Create symlink for setup-yabb.sh at root
421424
ln -s scripts/setup-yabb.sh "${ARCHIVE_NAME}/setup-yabb.sh"

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# SPDX-License-Identifier: 0BSD
2+
# Copyright (c) 2023-2026 Aryan Ameri
13
# =============================================================================
2-
# YABB - Yet Another BTRFS Backup
3-
# Comprehensive .gitignore following project standards
4+
# YABB .gitignore
45
# =============================================================================
56

67
# -----------------------------------------------------------------------------

.nph.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
# SPDX-License-Identifier: MPL-2.0
1+
# SPDX-License-Identifier: 0BSD
22
# Copyright (c) 2023-2026 Aryan Ameri
33
#
4-
# This Source Code Form is subject to the terms of the Mozilla Public
5-
# License, v. 2.0. If a copy of the MPL was not distributed with this
6-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
7-
#
84
# nph configuration for yabb project
95
# See: https://arnetheduck.github.io/nph/
106

Install.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ ALREADY installed to /etc/systemd/system/. Just enable the timer:
267267

268268
If you installed from tarball (Option B/C), copy the service files first:
269269

270-
sudo cp yabb-*/scripts/yabb.service /etc/systemd/system/
271-
sudo cp yabb-*/scripts/yabb.timer /etc/systemd/system/
270+
sudo cp yabb-*/config/yabb.service /etc/systemd/system/
271+
sudo cp yabb-*/config/yabb.timer /etc/systemd/system/
272272
sudo systemctl daemon-reload
273273
sudo systemctl enable --now yabb.timer
274274

0 commit comments

Comments
 (0)