-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement JSON Schema for PGXN Meta Spec v1
Based on the descriptions in `spec.md` and the validation in pgxn/pgxn-meta-validator, write JSON Schema v2020 schemas to validate PGXN Meta Spec `META.json` files. The implementation should be at least as good as the old one, now portable for use in other languages. In the process, correct a few issues and errors discovered in `spec.md` and increment its version to v1.0.2. Add a test suite in Rust that uses the boon crate to verify that the schemas, their IDs, and their examples are valid. This sets the stage for writing a validation utility in Rust. To keep things tidy and somewhat standardized, add a pre-commit configuration to lint the JSON and Rust code. Then setup a GitHub workflow to run the tests on macOS, Windows, and Linux, and the pre-commit linting on Linux. Overkill for now, since there is no Rust library, just tests for the JSON Schema, but likely to be needed before long.
- Loading branch information
Showing
26 changed files
with
1,230 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: 🧪 Test and Lint | ||
on: | ||
push: | ||
branches-ignore: [wip/**] | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [[🐧, Ubuntu], [🍎, macOS], [🪟, Windows]] | ||
toolchain: ["stable", "beta", "nightly"] | ||
name: 🦀 ${{ matrix.toolchain }} on ${{ matrix.os[0] }} ${{ matrix.os[1] }} | ||
runs-on: ${{ matrix.os[1] }}-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: { toolchain: "${{ matrix.toolchain }}" } | ||
- name: Test | ||
run: make test | ||
|
||
lint: | ||
name: 🔎 Lint and Cover | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Rust Cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Setup Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
/.vscode | ||
.DS_Store | ||
.idea/ | ||
/target | ||
.vscode/ | ||
vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# auth-global hooks will be managed / updated across all auth repos. | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
name: Lint trailing whitespace | ||
exclude_types: [image] | ||
- id: end-of-file-fixer | ||
name: Lint end-of-file newline | ||
exclude_types: [image] | ||
- id: check-added-large-files | ||
name: Don't permit large files | ||
exclude_types: [image] | ||
|
||
- repo: https://github.com/backplane/pre-commit-rust-hooks | ||
rev: v1.1.0 | ||
hooks: | ||
- id: fmt | ||
- id: check | ||
- id: clippy | ||
- id: test | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
name: JSON and YAML formatting | ||
types_or: [json, yaml] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.