From 92bba2b839133b1f24fa7902fb1c2f69209f8182 Mon Sep 17 00:00:00 2001 From: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Date: Tue, 1 Dec 2026 08:43:36 -0600 Subject: [PATCH] ci: run the CI checks at pre-commit and pre-push Install the pre-push hook type with pre-commit, add the CI checks that were missing locally, and document the setup in README.md and CONTRIBUTING.md. Co-Authored-By: Claude Sonnet 5.5 --- .pre-commit-config.yaml | 18 ++++++++++++++++++ CONTRIBUTING.md | 9 +++++++++ README.md | 4 ++++ 3 files changed, 31 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9cd9e8c..fbaf96f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +default_install_hook_types: [pre-commit, pre-push] repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 @@ -39,3 +40,20 @@ repos: hooks: - id: shfmt args: [-w, -i, '2', -ci, -bn] + + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.24.2 + hooks: + - id: markdownlint-cli2 + exclude: ^CHANGELOG\.md$ + + - repo: local + hooks: + - id: mkdocs-build + name: mkdocs build (plex-guide, sample config) + language: python + additional_dependencies: ['mkdocs>=1.6.1,<2', mkdocs-material, mkdocs-macros-plugin] + entry: bash -c 'cd plex-guide && cp mkdocs.sample.yml mkdocs.yml && mkdocs build -q; rc=$?; rm -rf mkdocs.yml site; exit $rc' + pass_filenames: false + files: ^plex-guide/ + stages: [pre-push] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e507c66 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,9 @@ +# Contributing + +## Development + +Run `pre-commit install` once per clone to install the commit and push hooks. + +- Commit hooks run markdownlint, ShellCheck, yamllint, and the other lint checks, matching CI. +- Push hooks build the Plex guide, matching CI. +- Run everything with `pre-commit run --all-files --hook-stage pre-push`. diff --git a/README.md b/README.md index 633a5dd..81d0a9f 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,10 @@ The sample config uses Material for MkDocs with a dark-first palette (slate) and ## Development +Run `pre-commit install` once per clone to install the commit and push hooks. Commit hooks run markdownlint, ShellCheck, yamllint, and the other lint checks, matching CI. Push hooks build the Plex guide, matching CI. Run everything with `pre-commit run --all-files --hook-stage pre-push`. + +To run the lint checks by hand: + ```bash npx markdownlint-cli2 "**/*.md" shellcheck plex-guide/setup.sh