From d555b90a1ccb77c10cac941cdc1b08fcea970ee3 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Tue, 10 Feb 2026 23:58:31 +0000 Subject: [PATCH 1/2] chore: add pre-commit configuration and CI --- .github/workflows/linter.yml | 17 +++++++++++++++++ .pre-commit-config.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/linter.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 0000000..d80b698 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,17 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0cd3c8d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + args: [--unsafe] + - id: check-json + - id: check-added-large-files + - id: detect-private-key + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.13 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v4.0.0-alpha.8 + hooks: + - id: prettier + files: \.(ts|tsx|js|jsx|json|md|yaml|yml|css|html)$ + - repo: https://github.com/codespell-project/codespell + rev: v2.4.1 + hooks: + - id: codespell + args: ["--skip", "*.lock,package-lock.json"] From deb707cd88e6a0181012a13c977473d1da138268 Mon Sep 17 00:00:00 2001 From: nearlyforget Date: Wed, 11 Feb 2026 05:11:07 +0000 Subject: [PATCH 2/2] chore: add license headers to config files --- .github/workflows/linter.yml | 14 ++++++++++++++ .pre-commit-config.yaml | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index d80b698..63207bf 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Lint on: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0cd3c8d..8c2dd37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + exclude: '^(\.github/|\.vscode/|node_modules/).*|CODE_OF_CONDUCT\.md|CHANGELOG\.md' repos: