Skip to content

Commit cf1f99d

Browse files
authored
feat: ✨ add URL Lychee checker to justfile (#244)
# Description This adds the Lychee URL checker as well as running on the repo and fixing URLs. No review needed. ## Checklist - [x] Ran `just run-all`
1 parent 1cf9a3f commit cf1f99d

19 files changed

Lines changed: 111 additions & 89 deletions

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# EditorConfig settings. Some editors will read these automatically;
2-
# for those that don't, see here: http://editorconfig.org/
2+
# for those that don't, see here: https://editorconfig.org/
33

44
root = true
55

404.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Let's get you back to greener grounds.
88

99
![](/_extensions/seedcase-project/seedcase-theme/images/404.svg){fig-alt="An illustration of the number 404 surrounded by trees and mountains"}
1010

11-
## Illustration by [Storyset](https://storyset.com/web) {.appendix}
11+
## Illustration by [Storyset](https://storyset.com/online) {.appendix}

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Changelog
22

33
Since we follow
4-
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits)
4+
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
55
when writing commit messages, we're able to automatically create formal
66
"releases" of the template based on the commit messages. Releases in the
77
context of template are when changes occur to the `template/` files or
88
to the `copier.yaml` files. The releases are also published to Zenodo
99
for easier discovery, archival, and citation purposes. We use
10-
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen)
10+
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
1111
to be able to automatically create these releases, which uses
1212
[SemVar](https://semverdoc.org) as the version numbering scheme.
1313

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ be reported by opening an issue or contacting one or more of the project
2626
maintainers.
2727

2828
This Code of Conduct is adapted from the Contributor Covenant
29-
(<https://contributor-covenant.org>), version 1.0.0, available at
30-
<https://contributor-covenant.org/version/1/0/0/>
29+
(<https://www.contributor-covenant.org>), version 1.0.0, available at
30+
<https://www.contributor-covenant.org/version/1/0/0/>

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ template. Both the uv and justfile websites have a more detailed guide
2323
on using uv, but below are some simple instructions to get you started.
2424

2525
It's easiest to install uv and justfile using
26-
[pipx](https://pypa.github.io/pipx/), so install that first. Then,
26+
[pipx](https://pipx.pypa.io/stable/), so install that first. Then,
2727
install uv and justfile by running:
2828

2929
``` bash
@@ -52,12 +52,12 @@ test it, it won't be able to test those changes. You have to commit the
5252
changes first in order for copier to use them.
5353

5454
When committing changes, please try to follow
55-
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits)
55+
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/)
5656
as Git messages. Using this convention allows us to be able to
5757
automatically create a release based on the commit message by using
58-
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen).
58+
[Commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/).
5959
If you don't use Conventional Commits when making a commit, we will
6060
revise the pull request title to follow that format, as we use
61-
[squash merges](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/squashing-commits/about-squash-merges)
62-
when merging pull requests, so all other commits in the pull request
63-
will be squashed into one commit.
61+
[squash merges](https://git-scm.com/docs/git-merge) when merging pull
62+
requests, when merging pull requests, so all other commits in the pull
63+
request will be squashed into one commit.

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,25 @@ status](https://results.pre-commit.ci/badge/github/seedcase-project/template-pyt
1919
state and is being actively
2020
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
2121

22-
This repository contains a [copier](https://copier.readthedocs.io/)
23-
template for setting up a new repository for a Python package. Along
24-
with a structured directory layout, this template includes
25-
configurations for tools that improve developer experience, continuous
26-
integration and delivery workflows, and supporting files for building
27-
robust Python packages.
22+
This repository contains a
23+
[copier](https://copier.readthedocs.io/en/stable/) template for setting
24+
up a new repository for a Python package. Along with a structured
25+
directory layout, this template includes configurations for tools that
26+
improve developer experience, continuous integration and delivery
27+
workflows, and supporting files for building robust Python packages.
2828

2929
Check out our
3030
[website](https://template-python-package.seedcase-project.org) for more
3131
information, such as the features it provides and a
32-
[guide](https://template-python-package.seedcase-project.org/docs/guide/)
32+
[guide](https://template-python-package.seedcase-project.org/docs/guide)
3333
to using the template. For a list of changes, see our
34-
[changelog](https://template-python-package.seedcase-project.org/docs/releases/)
34+
[changelog](https://template-python-package.seedcase-project.org/changelog.html)
3535
page.
3636

3737
## Contributing
3838

3939
Check out our [contributing
40-
page](https://template-python-package.seedcase-project.org/contributing/)
40+
page](https://template-python-package.seedcase-project.org/contributing)
4141
for information on how to contribute to the project, including how to
4242
set up your development environment.
4343

@@ -52,7 +52,8 @@ requests :tada:
5252

5353
[@lwjohnst86](https://github.com/lwjohnst86),
5454
[@martonvago](https://github.com/martonvago),
55-
[@signekb](https://github.com/signekb)
55+
[@signekb](https://github.com/signekb),
56+
[@joelostblom](https://github.com/joelostblom)
5657

5758
## Licensing
5859

README.qmd

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ metadata-files:
1111

1212
{{< include /docs/includes/_badges.qmd >}}
1313

14-
This repository contains a [copier](https://copier.readthedocs.io/)
15-
template for setting up a new repository for a Python package. Along
16-
with a structured directory layout, this template includes
17-
configurations for tools that improve developer experience, continuous
18-
integration and delivery workflows, and supporting files for building
19-
robust Python packages.
14+
This repository contains a
15+
[copier](https://copier.readthedocs.io/en/stable/) template for setting
16+
up a new repository for a Python package. Along with a structured
17+
directory layout, this template includes configurations for tools that
18+
improve developer experience, continuous integration and delivery
19+
workflows, and supporting files for building robust Python packages.
2020

2121
Check out our [website]({{< meta links.site >}}) for more information,
2222
such as the features it provides and a
23-
[guide]({{< meta links.site >}}/docs/guide/) to using the template. For
24-
a list of changes, see our
25-
[changelog]({{< meta links.site >}}/docs/releases/) page.
23+
[guide]({{< meta links.site >}}/docs/guide) to using the template. For a
24+
list of changes, see our
25+
[changelog]({{< meta links.site >}}/changelog.html) page.
2626

2727
## Contributing
2828

29-
Check out our [contributing page]({{< meta links.site >}}/contributing/)
29+
Check out our [contributing page]({{< meta links.site >}}/contributing)
3030
for information on how to contribute to the project, including how to
3131
set up your development environment.
3232

docs/includes/_contributors.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
The following people have contributed to this project by submitting pull requests :tada:
22

3-
[\@lwjohnst86](https://github.com/lwjohnst86), [\@martonvago](https://github.com/martonvago), [\@signekb](https://github.com/signekb)
3+
[\@lwjohnst86](https://github.com/lwjohnst86), [\@martonvago](https://github.com/martonvago), [\@signekb](https://github.com/signekb), [\@joelostblom](https://github.com/joelostblom)

index.qmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,17 @@ including for developing the package.
4343
- Uses [Quarto](https://quarto.org/) Markdown for the website content,
4444
allowing for easy integration of code, text, and figures.
4545
- Uses
46-
[Commitizen](https://decisions.seedcase-project.org/why-changelog-with-commitizen)
46+
[Commitizen](https://decisions.seedcase-project.org/why-changelog-with-commitizen/)
4747
to
4848
[check](https://decisions.seedcase-project.org/why-lint-with-commitizen/)
4949
commit messages and automatically create the changelog.
5050
- Automated Git tagging and GitHub releases with
5151
[commitizen](https://decisions.seedcase-project.org/why-semantic-release-with-commitizen/)
5252
that are based on messages following
53-
[Conventional
54-
Commits](https://decisions.seedcase-project.org/why-conventional-commits).
53+
[Conventional Commits](https://decisions.seedcase-project.org/why-conventional-commits/).
5554
- Uses a [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)
5655
license for the website content.
57-
- Uses an
58-
[MIT](https://decisions.seedcase-project.org/why-mit-license/index.html)
56+
- Uses an [MIT](https://decisions.seedcase-project.org/why-mit-license/)
5957
license for the code.
6058
- Optionally uses the
6159
[`seedcase-theme`](https://github.com/seedcase-project/seedcase-theme)
@@ -68,6 +66,8 @@ including for developing the package.
6866
- Uses [rumdl](https://rumdl.dev/) to format Markdown files so that they
6967
are standardized and consistent across the project, as well as being
7068
easier to read in raw form.
69+
- Checks URLs with [Lychee](https://lychee.cli.rs) to ensure they aren't
70+
broken or blocked.
7171

7272
## Want to contribute?
7373

justfile

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,89 @@
11
@_default:
22
just --list --unsorted
33

4-
@_checks: check-spelling check-commits
4+
@_checks: check-spelling check-urls check-commits
5+
56
# Test Seedcase and non-Seedcase projects
67
@_tests: (test "true" "netlify") (test "false" "netlify") (test "true" "gh-pages") (test "false" "gh-pages")
8+
79
@_builds: build-contributors build-website build-readme
810

911
# Run all build-related recipes in the justfile
1012
run-all: update-quarto-theme update-template _checks format-md _tests _builds
1113

1214
# Install the pre-commit hooks
1315
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
2022

2123
# Update the Quarto seedcase-theme extension
2224
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
2527

2628
# Update files in the template from the copier parent folder
2729
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/
3335

3436
# Check the commit messages on the current branch that are not on the main branch
3537
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"
4657

4758
# Check for spelling errors in files
4859
check-spelling:
49-
uvx typos
60+
uvx typos
5061

5162
# Format Markdown files
5263
format-md:
53-
uvx rumdl fmt --silent
64+
uvx rumdl fmt --silent
5465

5566
# 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")
5667
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 }}
5869

5970
# Test template with the manual questionnaire answers
6071
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
6374

6475
# Clean up any leftover and temporary build files
6576
cleanup:
66-
rm -rf _temp
77+
rm -rf _temp
6778

6879
# Build the website using Quarto
6980
build-website:
70-
uvx --from quarto quarto render
81+
uvx --from quarto quarto render
7182

7283
# Re-build the README file from the Quarto version
7384
build-readme:
74-
uvx --from quarto quarto render README.qmd --to gfm
85+
uvx --from quarto quarto render README.qmd --to gfm
7586

7687
# Generate a Quarto include file with the contributors
7788
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

Comments
 (0)