Skip to content

Commit

Permalink
Merge pull request #1988 from camptocamp/add-jsonschema-pre-commit
Browse files Browse the repository at this point in the history
Use the jsonschema pre-commit
  • Loading branch information
sbrunner authored Apr 6, 2023
2 parents 62d134a + e4125af commit 4d3840e
Show file tree
Hide file tree
Showing 7 changed files with 449 additions and 270 deletions.
35 changes: 28 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
ci:
autoupdate_schedule: quarterly
skip:
- copyright
- poetry-check
- poetry-lock
- ripsecrets
- jsonschema-gentypes
- jsonschema2md

repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
Expand All @@ -18,6 +28,24 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/camptocamp/jsonschema-gentypes
rev: 1.6.0
hooks:
- id: jsonschema-gentypes
files: |-
(?x)(
ĵsonschema-gentypes.yaml$
|^tilecloud_chain/schema\.json$
)
- repo: https://github.com/sbrunner/jsonschema2md2
rev: 0.7.0
hooks:
- id: jsonschema2md
files: tilecloud_chain/schema\.json
args:
- --pre-commit
- tilecloud_chain/schema.json
- tilecloud_chain/CONFIG.md
- repo: https://github.com/sbrunner/hooks
rev: 0.5.0
hooks:
Expand Down Expand Up @@ -89,10 +117,3 @@ repos:
- --tool=pydocstyle
- --die-on-tool-error
- --output-format=pylint
ci:
autoupdate_schedule: quarterly
skip:
- copyright
- poetry-check
- poetry-lock
- ripsecrets
14 changes: 0 additions & 14 deletions MANIFEST.in

This file was deleted.

4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,3 @@ tests-fast:
done

docker-compose exec -T test pytest -vv --color=yes --exitfirst #--last-failed

PHONY: jsonschema
jsonschema: ## Generate the files related to the JSON schema
jsonschema-gentypes
12 changes: 6 additions & 6 deletions jsonschema-gentypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ headers: |
"""
Automatically generated file from a JSON schema.
"""
callbacks:
- - pyupgrade
- --py38-plus
- --exit-zero-even-if-changed
- - black
- - isort
pre_commit:
enabled: true
arguments:
- --color=never

generate:
- source: tilecloud_chain/schema.json
destination: tilecloud_chain/configuration.py
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: GIS",
"Typing :: Typed",
]
include = ["tilecloud_chain/py.typed"]
include = ["tilecloud_chain/py.typed", "tilecloud_chain/*.rst", "tilecloud_chain/*.md"]

[tool.poetry.scripts]
generate-tiles = "tilecloud_chain.generate:main"
Expand Down
342 changes: 342 additions & 0 deletions tilecloud_chain/CONFIG.md

Large diffs are not rendered by default.

Loading

0 comments on commit 4d3840e

Please sign in to comment.