Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use Lychee pre-commit hook #193

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
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
49 changes: 0 additions & 49 deletions .github/workflows/links.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ __pycache__/

# env Folder
env/

# Lychee pre-commit hook
.lycheecache
58 changes: 46 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,63 @@ ci:

# Standard hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: mixed-line-ending
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: mixed-line-ending

# Lychee: check links
- repo: https://github.com/lycheeverse/lychee.git
rev: v0.15.1
hooks:
- id: lychee
pass_filenames: false
args:
- .
- --verbose
- --no-progress
- --timeout
- "10"
- --max-retries
- "5"
- --skip-missing
- --exclude-loopback
- --exclude
- https://twitter.com/*
- --exclude
- https://doi\.org|www.sciencedirect\.com/*
- --exclude
- https://plausible.io/pybamm.org
# Exclude the theme submodule and the built files. The latter are
# generated from the build and we don't bother with them because
# their links are either not relevant or are already checked.
- --exclude-path
- themes/
- --exclude-path
- static/
- --exclude-path
- public/
- --exclude-path
- resources/
- --accept
- 200,429,999

# Python files
- repo: https://github.com/astral-sh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
- id: ruff
args: ["--fix", "--show-fixes"]


# Spelling errors and typos
- repo: https://github.com/codespell-project/codespell
# Spelling errors and typos
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
- id: codespell
exclude: content/gsoc/2024/ankit-meda.md
args:
- "-Lrecuse,Meda"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# pybamm.org

[![Netlify](https://api.netlify.com/api/v1/badges/c4c60d47-1de1-4d0a-8a25-726d3cf100c8/deploy-status)](https://app.netlify.com/sites/pybamm-developer-preview/deploys)
[![Links](https://github.com/pybamm-team/pybamm.org/actions/workflows/links.yml/badge.svg)](https://github.com/pybamm-team/pybamm.org/actions/workflows/links.yml)
[![pre-commit.ci](https://results.pre-commit.ci/badge/github/pybamm-team/pybamm.org/main.svg)](https://results.pre-commit.ci/latest/github/pybamm-team/pybamm.org/main)
[![Gitpod](https://img.shields.io/badge/open%20in-Gitpod-blue?logo=gitpod)](https://gitpod.io/#https://github.com/pybamm-team/pybamm.org/)

Expand Down
2 changes: 1 addition & 1 deletion content/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ donations and how you can support, please see the [Donate](/donate/) page.
[Ionworks](https://ionworks.com/) is a company founded by members of the PyBaMM core development team to ensure [PyBaMM's long-term success](https://ionworks.com/blog/our-relationship-with-pybamm).
Ionworks provides support and custom feature development for PyBaMM, as well as software to make modeling easier and faster.
For companies who want to leverage the power, flexibility, and openness of the Python ecosystem for their battery simulation needs, Ionworks is the go-to partner.
[Contact Ionworks](https://ionworks.com/contact-us) to find out more.
[Contact Ionworks](https://ionworks.com/) to find out more.

{{< figure >}}
src = '/images/logos/ionworks-logo.png'
Expand Down
2 changes: 1 addition & 1 deletion content/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For general inquiries, other than topics listed above, you can contact us by ema
[Ionworks](https://ionworks.com/) is a company founded by members of the PyBaMM core development team to ensure [PyBaMM's long-term success](https://ionworks.com/blog/our-relationship-with-pybamm).
Ionworks provides support and custom feature development for PyBaMM, as well as software to make modeling easier and faster.
For companies who want to leverage the power, flexibility, and openness of the Python ecosystem for their battery simulation needs, Ionworks is the go-to partner.
[Contact Ionworks](https://ionworks.com/contact-us) to find out more.
[Contact Ionworks](mailto:info@ionworks.com) to find out more.

## Governance

Expand Down
2 changes: 1 addition & 1 deletion content/learn.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ We regularly hold PyBaMM workshops. You can find a list of the workshops we have

## Get help

You can get help by posting questions on the [PyBaMM Slack channels](https://pybamm.org/slack/) or preferably in [GitHub discussions](https://github.com/pybamm-team/PyBaMM/discussions). You can also get paid support from [Ionworks](https://ionworks.com/contact-us).
You can get help by posting questions on the [PyBaMM Slack channels](https://pybamm.org/slack/) or preferably in [GitHub discussions](https://github.com/pybamm-team/PyBaMM/discussions). You can also get paid support from [Ionworks](https://ionworks.com/).