|
1 | 1 | @_default: |
2 | 2 | just --list --unsorted |
3 | 3 |
|
4 | | -@_checks: check-spelling check-commits |
| 4 | +@_checks: check-spelling check-urls check-commits |
| 5 | + |
5 | 6 | # Test Seedcase and non-Seedcase projects |
6 | 7 | @_tests: (test "true" "netlify") (test "false" "netlify") (test "true" "gh-pages") (test "false" "gh-pages") |
| 8 | + |
7 | 9 | @_builds: build-contributors build-website build-readme |
8 | 10 |
|
9 | 11 | # Run all build-related recipes in the justfile |
10 | 12 | run-all: update-quarto-theme update-template _checks format-md _tests _builds |
11 | 13 |
|
12 | 14 | # Install the pre-commit hooks |
13 | 15 | install-precommit: |
14 | | - # Install pre-commit hooks |
15 | | - uvx pre-commit install |
16 | | - # Run pre-commit hooks on all files |
17 | | - uvx pre-commit run --all-files |
18 | | - # Update versions of pre-commit hooks |
19 | | - uvx pre-commit autoupdate |
| 16 | + # Install pre-commit hooks |
| 17 | + uvx pre-commit install |
| 18 | + # Run pre-commit hooks on all files |
| 19 | + uvx pre-commit run --all-files |
| 20 | + # Update versions of pre-commit hooks |
| 21 | + uvx pre-commit autoupdate |
20 | 22 |
|
21 | 23 | # Update the Quarto seedcase-theme extension |
22 | 24 | update-quarto-theme: |
23 | | - # Add theme if it doesn't exist, update if it does |
24 | | - quarto update seedcase-project/seedcase-theme --no-prompt |
| 25 | + # Add theme if it doesn't exist, update if it does |
| 26 | + quarto update seedcase-project/seedcase-theme --no-prompt |
25 | 27 |
|
26 | 28 | # Update files in the template from the copier parent folder |
27 | 29 | update-template: |
28 | | - cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig .rumdl.toml template/ |
29 | | - mkdir -p template/tools |
30 | | - cp tools/get-contributors.sh template/tools/ |
31 | | - cp .github/pull_request_template.md template/.github/ |
32 | | - cp .github/workflows/dependency-review.yml template/.github/workflows/ |
| 30 | + cp CODE_OF_CONDUCT.md .pre-commit-config.yaml .typos.toml .editorconfig .rumdl.toml template/ |
| 31 | + mkdir -p template/tools |
| 32 | + cp tools/get-contributors.sh template/tools/ |
| 33 | + cp .github/pull_request_template.md template/.github/ |
| 34 | + cp .github/workflows/dependency-review.yml template/.github/workflows/ |
33 | 35 |
|
34 | 36 | # Check the commit messages on the current branch that are not on the main branch |
35 | 37 | check-commits: |
36 | | - #!/usr/bin/env bash |
37 | | - branch_name=$(git rev-parse --abbrev-ref HEAD) |
38 | | - number_of_commits=$(git rev-list --count HEAD ^main) |
39 | | - if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]] |
40 | | - then |
41 | | - # If issue happens, try `uv tool update-shell` |
42 | | - uvx --from commitizen cz check --rev-range main..HEAD |
43 | | - else |
44 | | - echo "On 'main' or current branch doesn't have any commits." |
45 | | - fi |
| 38 | + #!/usr/bin/env bash |
| 39 | + branch_name=$(git rev-parse --abbrev-ref HEAD) |
| 40 | + number_of_commits=$(git rev-list --count HEAD ^main) |
| 41 | + if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]] |
| 42 | + then |
| 43 | + # If issue happens, try `uv tool update-shell` |
| 44 | + uvx --from commitizen cz check --rev-range main..HEAD |
| 45 | + else |
| 46 | + echo "On 'main' or current branch doesn't have any commits." |
| 47 | + fi |
| 48 | + |
| 49 | +# Install lychee from https://lychee.cli.rs/guides/getting-started/ |
| 50 | + |
| 51 | +# Check that URLs work |
| 52 | +check-urls: |
| 53 | + lychee . \ |
| 54 | + --verbose \ |
| 55 | + --extensions md,qmd,jinja \ |
| 56 | + --exclude-path "_badges.qmd" |
46 | 57 |
|
47 | 58 | # Check for spelling errors in files |
48 | 59 | check-spelling: |
49 | | - uvx typos |
| 60 | + uvx typos |
50 | 61 |
|
51 | 62 | # Format Markdown files |
52 | 63 | format-md: |
53 | | - uvx rumdl fmt --silent |
| 64 | + uvx rumdl fmt --silent |
54 | 65 |
|
55 | 66 | # Test that a Python package can be created from the template, with parameters for: `is_seedcase_project` (true or false) and `hosting_provider` (either "gh-pages" or "netlify") |
56 | 67 | test is_seedcase_project="true" hosting_provider="netlify": |
57 | | - sh ./test-template.sh {{ is_seedcase_project }} {{ hosting_provider }} |
| 68 | + sh ./test-template.sh {{ is_seedcase_project }} {{ hosting_provider }} |
58 | 69 |
|
59 | 70 | # Test template with the manual questionnaire answers |
60 | 71 | test-manual: |
61 | | - mkdir -p _temp/manual |
62 | | - uvx copier copy --trust -r HEAD . _temp/manual/test-template |
| 72 | + mkdir -p _temp/manual |
| 73 | + uvx copier copy --trust -r HEAD . _temp/manual/test-template |
63 | 74 |
|
64 | 75 | # Clean up any leftover and temporary build files |
65 | 76 | cleanup: |
66 | | - rm -rf _temp |
| 77 | + rm -rf _temp |
67 | 78 |
|
68 | 79 | # Build the website using Quarto |
69 | 80 | build-website: |
70 | | - uvx --from quarto quarto render |
| 81 | + uvx --from quarto quarto render |
71 | 82 |
|
72 | 83 | # Re-build the README file from the Quarto version |
73 | 84 | build-readme: |
74 | | - uvx --from quarto quarto render README.qmd --to gfm |
| 85 | + uvx --from quarto quarto render README.qmd --to gfm |
75 | 86 |
|
76 | 87 | # Generate a Quarto include file with the contributors |
77 | 88 | build-contributors: |
78 | | - sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd |
| 89 | + sh ./tools/get-contributors.sh seedcase-project/template-python-project > docs/includes/_contributors.qmd |
0 commit comments