diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fe278c4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,40 @@ +repos: + # Ruff formatter + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.6 + hooks: + - id: ruff-format + name: ruff format + description: Format Python code with ruff + + # Ruff linter + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.6 + hooks: + - id: ruff + name: ruff check --fix + description: Lint Python code with ruff and auto-fix issues + args: [--fix] + + # Pyrefly type checker + - repo: local + hooks: + - id: pyrefly + name: pyrefly check + description: Type check Python code with pyrefly + entry: .venv/bin/pyrefly + args: [check] + language: system + types: [python] + + # Pytest tests + - repo: local + hooks: + - id: pytest + name: pytest + description: Run tests with pytest + entry: .venv/bin/pytest + language: system + types: [python] + pass_filenames: false + always_run: true diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 7ce8c94..95fc346 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -60,6 +60,7 @@ export default defineConfig({ { label: "template", link: "/reference/cli/template/" }, { label: "list", link: "/reference/cli/list/" }, { label: "status", link: "/reference/cli/status/" }, + { label: "sync", link: "/reference/cli/sync/" }, { label: "update", link: "/reference/cli/update/" }, { label: "add-hook", link: "/reference/cli/add-hook/" }, ], diff --git a/docs/src/content/docs/guides/automatic-updates.mdx b/docs/src/content/docs/guides/automatic-updates.mdx index 73a7dd1..bff74f6 100644 --- a/docs/src/content/docs/guides/automatic-updates.mdx +++ b/docs/src/content/docs/guides/automatic-updates.mdx @@ -7,7 +7,7 @@ import { Aside } from "@astrojs/starlight/components"; > **Note:** This guide primarily describes features beneficial for **Consumers** – those using libraries managed by a Creator. The setup of the hook itself might be done by a Creator or an advanced Consumer. -KiLM provides a helper command [`kilm add-hook`](/reference/cli/add-hook/) to easily create a basic `post-merge` Git hook that runs `kilm update`. +KiLM provides a helper command [`kilm add-hook`](/reference/cli/add-hook/) to easily create a basic `post-merge` Git hook that runs `kilm sync`. ## Using `kilm add-hook` (Recommended) @@ -17,7 +17,7 @@ Navigate to the root of your Git repository containing your KiCad libraries and kilm add-hook ``` -This creates a `.git/hooks/post-merge` script that automatically executes `kilm update` every time you successfully run `git pull` or `git merge` in that repository. +This creates a `.git/hooks/post-merge` script that automatically executes `kilm sync` every time you successfully run `git pull` or `git merge` in that repository.