Skip to content

Commit

Permalink
Merge pull request #8 from statisticsnorway/update-documentation
Browse files Browse the repository at this point in the history
Add pre-commit and update README
  • Loading branch information
johnksv authored Jan 17, 2024
2 parents d40e2dc + ea237f2 commit 1af1ccc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pre-commit

on: push

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.3
hooks:
- id: check-metaschema
files: ^src/.*\.json$
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# dapla-kuben-resource-model

jsonschemas which defines how resources used in kuben are defined. Useful for validation and code generation.

## Contributing

This repository uses [pre-commit](https://pre-commit.com/) to ensure that all schemas are formatted correctly before
committed.
Install the pre-commit hooks by running `pre-commit install && pre-commit install-hooks`.
The pre-commit hooks will also run as a github workflow for each push

Code under generated is generated from the JSON schemas under src. Files here should not be modified manually (only
exception is pom.xml).

Usual workflow is:
1. Create branch
2. Make changes to your schema
3. Run `pre-commit run --all-files` to format your schema
4. Commit and push your changes
5. Github action will run and generate code from your schema
6. Create a PR and merge it when it is ready

Create release:
1. Pull latest changes from main
2. Create a branch with name `release-java`
3. Push the branch
4.
5. Profit

0 comments on commit 1af1ccc

Please sign in to comment.