Skip to content

Commit b710d49

Browse files
authored
build: 🔨 update build files from template (#80)
# Description Updated from template. No review needed.
1 parent 6d214eb commit b710d49

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ repos:
1515
hooks:
1616
- id: trailing-whitespace
1717
- id: end-of-file-fixer
18+
- id: check-merge-conflict
19+
args: [--assume-in-merge]
1820

1921
- repo: https://github.com/commitizen-tools/commitizen
2022
rev: v4.10.0

.typos.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ extend-exclude = [
33
"*.css",
44
".quarto/*",
55
"_site/*",
6+
"_book/*",
67
"*.svg"
78
]
8-
9-
[default.extend-words]
10-
TRE = "TRE" # trusted research environment
11-
SME = "SME" # small and medium-sized enterprises

justfile

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
@_default:
22
just --list --unsorted
33

4-
# Run all necessary build commands.
5-
run-all: check-spelling check-commits build-website
4+
@_checks: check-spelling check-commits
5+
@_builds: build-contributors build-readme build-website
6+
7+
# Run all necessary build commands
8+
run-all: update-quarto-theme _checks _builds
9+
10+
# List all TODO items in the repository
11+
list-todos:
12+
grep -R -n \
13+
--exclude="*.code-snippets" \
14+
--exclude-dir=.quarto \
15+
--exclude=justfile \
16+
--exclude=_site \
17+
"TODO" *
18+
19+
# Update the Quarto seedcase-theme extension
20+
update-quarto-theme:
21+
# # Add theme if it doesn't exist, update if it does
22+
quarto update seedcase-project/seedcase-theme --no-prompt
623

724
# Install the pre-commit hooks
825
install-precommit:
@@ -17,18 +34,35 @@ install-precommit:
1734
check-spelling:
1835
uvx typos
1936

20-
# Run checks on commits with non-main branches
37+
# Check the commit messages on the current branch that are not on the main branch
2138
check-commits:
22-
#!/bin/zsh
39+
#!/usr/bin/env bash
2340
branch_name=$(git rev-parse --abbrev-ref HEAD)
2441
number_of_commits=$(git rev-list --count HEAD ^main)
2542
if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
2643
then
44+
# If issue happens, try `uv tool update-shell`
2745
uvx --from commitizen cz check --rev-range main..HEAD
2846
else
29-
echo "Can't either be on ${branch_name} or have more than ${number_of_commits}."
47+
echo "On 'main' or current branch doesn't have any commits."
3048
fi
3149

3250
# Build the website using Quarto
3351
build-website:
3452
quarto render
53+
54+
# Re-build the README file from the Quarto version
55+
build-readme:
56+
uvx --from quarto quarto render README.qmd --to gfm
57+
58+
# Generate a Quarto include file with the contributors
59+
build-contributors:
60+
sh ./tools/get-contributors.sh seedcase-project/guidebook > includes/_contributors.qmd
61+
62+
# Check for and apply updates from the template
63+
update-from-template:
64+
uvx copier update --trust --defaults
65+
66+
# Reset repo changes to match the template
67+
reset-from-template:
68+
uvx copier recopy --trust --defaults

0 commit comments

Comments
 (0)