|
| 1 | +# Copyright 2024-Present Couchbase, Inc. |
| 2 | +# |
| 3 | +# Use of this software is governed by the Business Source License included in |
| 4 | +# the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that |
| 5 | +# file, in accordance with the Business Source License, use of this software |
| 6 | +# will be governed by the Apache License, Version 2.0, included in the file |
| 7 | +# licenses/APL2.txt. |
| 8 | + |
| 9 | +repos: |
| 10 | + - repo: local |
| 11 | + hooks: |
| 12 | + - id: addlicense |
| 13 | + name: addlicense |
| 14 | + language: system |
| 15 | + entry: go run github.com/google/addlicense@latest -f licenses/addlicense.tmpl |
| 16 | + types_or: [go, python] |
| 17 | + |
| 18 | + - id: goimports |
| 19 | + name: goimports |
| 20 | + language: system |
| 21 | + entry: go run golang.org/x/tools/cmd/goimports@latest |
| 22 | + args: [-w] |
| 23 | + types: [go] |
| 24 | + |
| 25 | + - id: golangci-lint |
| 26 | + name: golangci-lint |
| 27 | + language: system |
| 28 | + # version must match .github/workflows/ci.yml golangci job |
| 29 | + entry: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.12.2 |
| 30 | + args: [run, --config=.golangci-strict.yml, --fix=false] |
| 31 | + types: [go] |
| 32 | + pass_filenames: false |
| 33 | + |
| 34 | + - id: ruff-format |
| 35 | + name: ruff format |
| 36 | + language: system |
| 37 | + entry: uv run -- ruff format |
| 38 | + types: [python] |
| 39 | + |
| 40 | + - id: mypy |
| 41 | + name: mypy |
| 42 | + language: system |
| 43 | + entry: uv run -- mypy |
| 44 | + pass_filenames: false |
| 45 | + files: ^(pyproject\.toml|.*\.py)$ |
| 46 | + |
| 47 | + - id: manifest-product-config-sorted |
| 48 | + name: manifest/product-config.json keys sorted |
| 49 | + language: system |
| 50 | + entry: bash -c 'diff <(jq --sort-keys . manifest/product-config.json) <(jq . manifest/product-config.json)' |
| 51 | + files: ^manifest/product-config\.json$ |
| 52 | + pass_filenames: false |
| 53 | + |
| 54 | + - id: redocly-lint |
| 55 | + name: redocly lint |
| 56 | + language: system |
| 57 | + entry: npx --yes @redocly/cli@2 lint --config=.redocly.yaml --format=stylish |
| 58 | + files: ^(docs/api/|\.redocly\.yaml$) |
| 59 | + pass_filenames: false |
| 60 | + |
| 61 | + - id: yamllint |
| 62 | + name: yamllint |
| 63 | + language: system |
| 64 | + entry: yamllint |
| 65 | + args: [docs/api] |
| 66 | + files: ^docs/api/ |
| 67 | + pass_filenames: false |
| 68 | + |
| 69 | + - id: shellcheck |
| 70 | + name: shellcheck |
| 71 | + language: system |
| 72 | + entry: shellcheck |
| 73 | + types: [shell] |
| 74 | + exclude: >- |
| 75 | + (?x)^( |
| 76 | + build\.sh| |
| 77 | + bootstrap\.sh| |
| 78 | + bench\.sh| |
| 79 | + build/postinst\.tmpl| |
| 80 | + build/postrm\.tmpl| |
| 81 | + integration-test/service-test\.sh| |
| 82 | + integration-test/service-install-tests\.sh| |
| 83 | + rewrite-manifest\.sh| |
| 84 | + snap-manifest\.sh| |
| 85 | + set-version-stamp\.sh| |
| 86 | + service/sync_gateway_service_install\.sh| |
| 87 | + service/sync_gateway_service_uninstall\.sh| |
| 88 | + service/sync_gateway_service_upgrade\.sh| |
| 89 | + test-integration-init\.sh| |
| 90 | + test\.sh |
| 91 | + )$ |
0 commit comments