Skip to content

Commit

Permalink
Use pre-commit hook from jsonschema-gentypes
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Apr 4, 2023
1 parent 0715a3d commit e9fa87a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 67 deletions.
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ 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$
|^c2cciutils/schema.*\.json$
)
- repo: https://github.com/sbrunner/hooks
rev: 0.5.0
hooks:
Expand Down
37 changes: 0 additions & 37 deletions c2cciutils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ class Audit(TypedDict, total=False):
outdated_versions: "AuditOutdatedVersions"
snyk: "AuditWithSnyk"
print_versions: "PrintVersions"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""


AuditOutdatedVersions = bool
Expand Down Expand Up @@ -358,10 +354,6 @@ class Checks(TypedDict, total=False):
snyk_fix: "ChecksWithSnykFix"
prettier: "ChecksPrettier"
print_versions: "PrintVersions"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""


ChecksBlack = Union["ChecksBlackConfig", bool]
Expand Down Expand Up @@ -628,23 +620,11 @@ class ChecksSnykIacConfiguration(TypedDict, total=False):
Configuration = TypedDict(
"Configuration",
{
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"audit": "Audit",
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"checks": "Checks",
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"pr-checks": "PullRequestChecks",
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"publish": "Publish",
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"version": "Version",
# WARNING: The required are not correctly taken in account,
# See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"k8s": "K8SConfiguration",
},
total=False,
Expand Down Expand Up @@ -755,16 +735,7 @@ class K8SConfiguration(TypedDict, total=False):
"""

k3d: "K3DConfiguration"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""

db: "DbConfiguration"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""


K8S_CONFIGURATION_DEFAULT: Dict[str, Any] = {}
Expand Down Expand Up @@ -931,10 +902,6 @@ class Publish(TypedDict, total=False):
helm: "PublishHelm"
google_calendar: "PublishGoogleCalendar"
print_versions: "PrintVersions"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""


PublishDocker = Union["PublishDockerConfig", Literal[False]]
Expand Down Expand Up @@ -993,10 +960,6 @@ class PublishDockerConfig(TypedDict, total=False):
"""

snyk: "_PublishDockerConfigSnyk"
"""
WARNING: The required are not correctly taken in account,
See: https://github.com/camptocamp/jsonschema-gentypes/issues/6
"""


class PublishDockerImage(TypedDict, total=False):
Expand Down
9 changes: 6 additions & 3 deletions jsonschema-gentypes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ headers: |
"""
Automatically generated file from a JSON schema.
"""
callbacks:
- - black
- - isort
pre_commit:
enabled: true
arguments:
- --color=never

generate:
- source: c2cciutils/schema.json
destination: c2cciutils/configuration.py
Expand Down
27 changes: 1 addition & 26 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ google-auth-httplib2 = { version = "0.1.0", optional = true }
google-auth-oauthlib = { version = "1.0.0", optional = true }
"ruamel.yaml" = "0.17.21"
jsonschema = "4.17.3"
jsonschema-gentypes = "1.5.0"
node-vm2 = "0.4.5"
defusedxml = "0.7.1"
black = { version = "22.12.0", optional = true }
Expand Down

0 comments on commit e9fa87a

Please sign in to comment.