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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
61 changes: 48 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,64 @@ ci:

# Standard hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.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
entry: 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
# Python files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.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