Skip to content

Commit 0dcaa89

Browse files
committed
feat: openapi-spec-validator
1 parent 9364dc0 commit 0dcaa89

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ clang-format supports.
377377
- [headache](https://github.com/frama-c/headache)
378378
- [mixed-line-endings](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/mixed_line_ending.py)
379379
- [mkdocs-linkcheck](https://github.com/byrnereese/linkchecker-mkdocs)
380+
- [openapi-spec-validator](https://github.com/python-openapi/openapi-spec-validator)
380381
- [prettier](https://prettier.io)
381382
- [sort-file-contents](https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/file_contents_sorter.py)
382383
- [tagref](https://github.com/stepchowfun/tagref)

modules/hooks.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ in
4949
++ [ (mkRenamedOptionModule [ "settings" "rome" ] [ "hooks" "biome" "settings" ]) ]
5050
# Rename the remaining `settings.<name>` to `hooks.<name>.settings`
5151
++ map (name: mkRenamedOptionModule [ "settings" name ] [ "hooks" name "settings" ])
52-
[ "ansible-lint" "autoflake" "biome" "clippy" "cmake-format" "credo" "deadnix" "denofmt" "denolint" "dune-fmt" "eslint" "flake8" "headache" "hlint" "hpack" "isort" "latexindent" "lychee" "mkdocs-linkcheck" "mypy" "nixfmt" "ormolu" "php-cs-fixer" "phpcbf" "phpcs" "phpstan" "prettier" "psalm" "pylint" "pyright" "pyupgrade" "revive" "statix" ];
52+
[ "ansible-lint" "autoflake" "biome" "clippy" "cmake-format" "credo" "deadnix" "denofmt" "denolint" "dune-fmt" "eslint" "flake8" "headache" "hlint" "hpack" "isort" "latexindent" "lychee" "mkdocs-linkcheck" "mypy" "nixfmt" "openapi-spec-validator" "ormolu" "php-cs-fixer" "phpcbf" "phpcs" "phpstan" "prettier" "psalm" "pylint" "pyright" "pyupgrade" "revive" "statix" ];
5353

5454
options.hookModule = lib.mkOption {
5555
type = types.deferredModule;
@@ -3188,6 +3188,14 @@ lib.escapeShellArgs (lib.concatMap (ext: [ "--ghc-opt" "-X${ext}" ]) hooks.ormol
31883188
entry = "${hooks.opam-lint.package}/bin/opam lint";
31893189
files = "\\.opam$";
31903190
};
3191+
openapi-spec-validator =
3192+
{
3193+
name = "openapi spec validator";
3194+
description = "A tool to validate OpenAPI spec files";
3195+
package = tools.openapi-spec-validator;
3196+
entry = "${hooks.openapi-spec-validator.package}/bin/openapi-spec-validator";
3197+
files = ".*openapi.*\\.(json|yaml|yml)$";
3198+
};
31913199
ormolu =
31923200
{
31933201
name = "ormolu";

nix/tools.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ in
172172
inherit (luaPackages) luacheck;
173173
inherit (nodePackages) eslint markdownlint-cli prettier cspell;
174174
inherit (ocamlPackages) ocp-indent;
175-
inherit (python3Packages) autoflake black flake8 flynt isort mkdocs-linkcheck mypy pre-commit-hooks pylint pyupgrade;
175+
inherit (python3Packages) autoflake black flake8 flynt isort mkdocs-linkcheck mypy openapi-spec-validator pre-commit-hooks pylint pyupgrade;
176176
inherit (php82Packages) php-cs-fixer psalm;
177177
# FIXME: workaround build failure
178178
phpstan = php82Packages.phpstan.overrideAttrs (old: {

0 commit comments

Comments
 (0)