Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
chore: move schemas to docs, not include in repo
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinNitroG committed Jan 12, 2025
1 parent dbcc07e commit b156519
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 265 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@ jobs:
python-version-file: '.python-version'
cache: 'pip'
cache-dependency-path: |
requirements/requirements-dev.txt
requirements/requirements.txt
- name: Install deps including dev
run: uv sync
- uses: extractions/setup-just@v2

- name: Pre-commit check
env:
SKIP: generate-config-schemas
run: uv run pre-commit run -a
- name: Install deps
run: uv sync --frozen --no-dev

- name: Generate schemas
run: just gen-schemas

- uses: pre-commit/[email protected]
with:
extra_args: -a --hook-stage manual
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/config.json
/schemas
/schemas_site
/mkdocs-include-markdown-cache
/.cache
Expand Down
27 changes: 16 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ repos:
hooks:
- id: check-github-workflows
- id: check-jsonschema
stages:
- manual
files: '^(check-phat-nguoi)?(\.)?config(\.)?(sample)?\.json$'
args: ['--schemafile', 'schemas/config.json']

Expand Down Expand Up @@ -83,14 +85,17 @@ repos:
'--quiet',
]

- repo: local
hooks:
- id: generate-config-schemas
name: Generate Config Schemas
language: system
entry: uv run generate-config-schema
files: '^src/check_phat_nguoi/config/'
types: [file, python]
stages:
- pre-commit
require_serial: true
# NOTE: Create schemas on CI already

# - repo: local
# hooks:
# - id: generate-config-schemas
# name: Generate Config Schemas
# language: system
# entry: uv run generate-config-schema
# files: '^src/check_phat_nguoi/config/'
# types: [file, python]
# stages:
# - pre-commit
# - manual
# require_serial: true
2 changes: 1 addition & 1 deletion config.sample.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/KevinNitroG/check-phat-nguoi/refs/heads/main/schemas/config.json",
"$schema": "https://raw.githubusercontent.com/KevinNitroG/check-phat-nguoi/refs/heads/main/site/schemas/config.json",
"plates_infos": [
{
"plate": "59XA00000",
Expand Down
16 changes: 4 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,18 @@ run-check-phat-nguoi: restore-env
gen-schemas: restore-env
uv run generate-schemas --frozen

gen-config-schema: restore-env
uv run gen-config-schema --frozen

web-dev: restore-env
rm ./site/ -rf || true
uv run mkdocs serve

build-web-mkdocs: restore-env
build-web: restore-env
rm ./site/ -rf || true
uv run mkdocs build

build-web-schemas: restore-env
rm ./site/schemas/ -rf || true
mkdir ./site/schemas/ -p
just gen-schemas
uv run generate-schema-doc --config-file jsfh-conf.yaml ./schemas/ ./site/schemas/

build-web: restore-env
just build-web-mkdocs
just build-web-schemas
uv run generate-schemas --frozen
cp ./schemas/* ./site/schemas
uv run generate-schema-doc --config-file jsfh-conf.yaml ./site/schemas/

clean: restore-env
uvx cleanpy@0.5.1 .
Expand Down
234 changes: 0 additions & 234 deletions schemas/config.json

This file was deleted.

0 comments on commit b156519

Please sign in to comment.