Skip to content
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: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
with:
enable-cache: true

- name: Install justfile and zsh
run: sudo apt install -y just zsh
- name: Install justfile
run: sudo apt install -y just

- name: Set Git user
run: |
Expand Down
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ install-precommit:

# Check the commit messages on the current branch that are not on the main branch
check-commits:
#!/bin/zsh
#!/usr/bin/env bash
branch_name=$(git rev-parse --abbrev-ref HEAD)
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
# If issue happens, try `uv tool update-shell`
uvx --from commitizen cz check --rev-range main..HEAD
else
echo "On `main` or current branch doesn't have any commits."
echo "On 'main' or current branch doesn't have any commits."
fi

# Check for spelling errors in files
Expand All @@ -31,7 +32,7 @@ check-spelling:

# Test and check that a data package can be created from the template
test:
#!/bin/zsh
#!/usr/bin/env bash
test_name="test-data-package"
test_dir="$(pwd)/_temp/$test_name"
template_dir="$(pwd)"
Expand Down Expand Up @@ -88,7 +89,6 @@ test:

# Clean up any leftover and temporary build files
cleanup:
#!/bin/zsh
rm -rf _temp

# Build the website using Quarto
Expand Down
11 changes: 6 additions & 5 deletions template/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ format-python:
uv run ruff check --fix .
uv run ruff format .

# Run checks on commits with non-main branches
# Check the commit messages on the current branch that are not on the main branch
check-commits:
#!/bin/zsh
#!/usr/bin/env bash
branch_name=$(git rev-parse --abbrev-ref HEAD)
number_of_commits=$(git rev-list --count HEAD ^$branch_name)
number_of_commits=$(git rev-list --count HEAD ^main)
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
then
uv run cz check --rev-range main..HEAD
# If issue happens, try `uv tool update-shell`
uvx --from commitizen cz check --rev-range main..HEAD
else
echo "Not on main or haven't committed yet."
echo "On 'main' or current branch doesn't have any commits."
fi

# Check for spelling errors in files
Expand Down
Loading