From f24218dadcf31fb2b597fa1df8d01ed9e11cbda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20Pa=C5=99ilov=C3=A1?= Date: Wed, 11 Nov 2026 12:56:12 +0100 Subject: [PATCH] HYPERFLEET-1810 - chore: add pre-commit config --- .gitignore | 2 +- .pre-commit-config.yaml | 35 +++++++++++++++++++++++++++++ CHANGELOG.md | 9 +++++++- core/services/statuses-internal.tsp | 1 - main.tsp | 2 +- package-lock.json | 4 ++-- package.json | 2 +- schemas/core/openapi.yaml | 2 +- 8 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index 2ae27c5..d936cf3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ node_modules/ tsp-output/ -tsp-output-*/ \ No newline at end of file +tsp-output-*/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..badf122 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +# Installs both pre-commit and commit-msg hooks with a `pre-commit install` +default_install_hook_types: [pre-commit, commit-msg] + +repos: + # Secret scanning + - repo: https://github.com/leaktk/leaktk + rev: 398b9d71573e1bf99b4eed0271729c4796df57ff # frozen: v0.3.13 + hooks: + - id: leaktk.git.pre-commit + + # HyperFleet commit message standard + - repo: https://github.com/openshift-hyperfleet/hyperfleet-hooks + rev: 0c42dbf10d4087ac8c788b19b9d29afd7bccdd4a # frozen: v0.3.0 + hooks: + - id: hyperfleet-commitlint + stages: [commit-msg] + + # Schema build + Spectral lint. Needs `npm install` first; rewrites schemas/ when + # the TypeSpec sources changed, so commit the regenerated files with the change. + - repo: local + hooks: + - id: build-and-lint-schema + name: Build and lint OpenAPI schema + entry: bash -c './build-schema.sh && npx spectral lint schemas/core/openapi.yaml --fail-severity warn' + language: system + files: \.tsp$ + pass_filenames: false + + # File hygiene + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0 + hooks: + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer diff --git a/CHANGELOG.md b/CHANGELOG.md index 26bcda8..cc39305 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.28] - 2026-11-11 + +### Added + +- `.pre-commit-config.yaml` with LeakTK secret scanning, HyperFleet commitlint, schema build and Spectral lint, and whitespace and end-of-file fixers (HYPERFLEET-1810) + ## [1.0.27] - 2026-08-11 ### Added @@ -246,7 +252,8 @@ First official stable release of the HyperFleet API specification. - Interactive API documentation -[Unreleased]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.27...HEAD +[Unreleased]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.28...HEAD +[1.0.28]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.27...v1.0.28 [1.0.27]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.26...v1.0.27 [1.0.26]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.25...v1.0.26 [1.0.25]: https://github.com/openshift-hyperfleet/hyperfleet-api-spec/compare/v1.0.24...v1.0.25 diff --git a/core/services/statuses-internal.tsp b/core/services/statuses-internal.tsp index 289cac5..b6df61e 100644 --- a/core/services/statuses-internal.tsp +++ b/core/services/statuses-internal.tsp @@ -104,4 +104,3 @@ interface NodePoolStatuses { | UnauthorizedResponse | NotFoundResponse; } - diff --git a/main.tsp b/main.tsp index 19d4184..c535a47 100644 --- a/main.tsp +++ b/main.tsp @@ -30,7 +30,7 @@ using OpenAPI; */ @service(#{ title: "HyperFleet API" }) @info(#{ - version: "1.0.27", + version: "1.0.28", contact: #{ name: "HyperFleet Team", url: "https://github.com/openshift-hyperfleet", diff --git a/package-lock.json b/package-lock.json index 76e54aa..9c802d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "hyperfleet", - "version": "1.0.27", + "version": "1.0.28", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hyperfleet", - "version": "1.0.27", + "version": "1.0.28", "devDependencies": { "@stoplight/spectral-cli": "6.15.1", "@typespec/compiler": "^1.6.0", diff --git a/package.json b/package.json index d3b11d2..74339bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hyperfleet", - "version": "1.0.27", + "version": "1.0.28", "type": "module", "exports": { "./*": "./*" diff --git a/schemas/core/openapi.yaml b/schemas/core/openapi.yaml index ff8fcb9..e6445cd 100644 --- a/schemas/core/openapi.yaml +++ b/schemas/core/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.0 info: title: HyperFleet API - version: 1.0.27 + version: 1.0.28 contact: name: HyperFleet Team url: https://github.com/openshift-hyperfleet