Skip to content

Commit d47efd3

Browse files
committed
🪨 YAMLRocks!
1 parent c606f9a commit d47efd3

368 files changed

Lines changed: 51333 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clusterfuzzlite/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Build environment for ClusterFuzzLite. base-builder-rust provides the Rust
2+
# toolchain, cargo-fuzz, and the sanitizer setup that OSS-Fuzz uses.
3+
FROM gcr.io/oss-fuzz-base/base-builder-rust
4+
5+
COPY . $SRC/yamlrocks
6+
WORKDIR $SRC/yamlrocks
7+
COPY .clusterfuzzlite/build.sh $SRC/build.sh

.clusterfuzzlite/build.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -eu
2+
# Compile every libFuzzer target and copy the binaries to $OUT, as
3+
# ClusterFuzzLite/OSS-Fuzz expect. base-builder-rust supplies cargo-fuzz and the
4+
# RUSTFLAGS for the active sanitizer.
5+
cd "$SRC/yamlrocks"
6+
7+
cargo fuzz build -O
8+
9+
# The release directory lives under a target-triple subdirectory; there is
10+
# exactly one, so a glob resolves it without hardcoding the triple.
11+
for target in fuzz/fuzz_targets/*.rs; do
12+
name="$(basename "${target%.*}")"
13+
cp fuzz/target/*/release/"${name}" "$OUT/"
14+
done

.clusterfuzzlite/project.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: rust
2+
sanitizers:
3+
- address
4+
fuzzing_engines:
5+
- libfuzzer

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "yamlrocks",
3+
"image": "mcr.microsoft.com/devcontainers/rust:1-bookworm",
4+
"features": {
5+
"ghcr.io/devcontainers/features/python:1": {
6+
"version": "3.14",
7+
"installTools": true
8+
},
9+
"ghcr.io/devcontainers/features/node:1": {
10+
"version": "lts"
11+
}
12+
},
13+
"postCreateCommand": ".devcontainer/post-create.sh",
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"rust-lang.rust-analyzer",
18+
"ms-python.python",
19+
"charliermarsh.ruff",
20+
"tamasfe.even-better-toml",
21+
"astro-build.astro-vscode",
22+
"redhat.vscode-yaml"
23+
],
24+
"settings": {
25+
"python.defaultInterpreterPath": "/workspaces/yamlrocks/.venv/bin/python",
26+
"[python]": {
27+
"editor.defaultFormatter": "charliermarsh.ruff"
28+
},
29+
"[rust]": {
30+
"editor.defaultFormatter": "rust-lang.rust-analyzer"
31+
},
32+
"editor.formatOnSave": true,
33+
"files.insertFinalNewline": true,
34+
"files.trimTrailingWhitespace": true
35+
}
36+
}
37+
},
38+
"remoteUser": "vscode"
39+
}

.devcontainer/post-create.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
# Set up the yamlrocks development environment inside the dev container.
3+
set -euo pipefail
4+
5+
echo "Creating virtual environment and installing tooling..."
6+
python3 -m venv .venv
7+
# shellcheck disable=SC1091
8+
source .venv/bin/activate
9+
10+
pip install --upgrade pip
11+
pip install maturin pytest pyyaml ruff mypy codespell
12+
13+
echo "Adding Rust components..."
14+
rustup component add rustfmt clippy
15+
16+
echo "Building yamlrocks (debug)..."
17+
maturin develop
18+
19+
echo
20+
echo "Dev container ready. Activate with: source .venv/bin/activate"
21+
echo "Run the tests with: pytest -q"

.editorconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 4
10+
11+
[*.{rs}]
12+
indent_size = 4
13+
14+
[*.{py,pyi}]
15+
indent_size = 4
16+
17+
[*.{yaml,yml,json,toml,md,mdx,mjs,js,ts}]
18+
indent_size = 2
19+
20+
[Makefile]
21+
indent_style = tab
22+
23+
# Vendored test data and snapshots are kept byte-for-byte.
24+
[tests/yaml_test_suite/cases/**]
25+
trim_trailing_whitespace = false
26+
insert_final_newline = false
27+
28+
[tests/snapshots/**]
29+
trim_trailing_whitespace = false
30+
insert_final_newline = false

.gitattributes

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Normalize text files to LF in the repository and working tree, so the parser's
2+
# byte-for-byte round-trip and snapshot tests stay stable on every platform; a
3+
# CRLF checkout would otherwise change file bytes and fail them. Files that git
4+
# detects as binary (some test fixtures hold non-UTF-8 bytes by design) are left
5+
# exactly as committed.
6+
* text=auto eol=lf
7+
8+
# Flag whitespace errors in diffs for the code we hand-write.
9+
*.py whitespace=error
10+
*.rs whitespace=error
11+
12+
# Keep lockfiles and generated artifacts out of GitHub's language statistics.
13+
Cargo.lock linguist-generated=true
14+
uv.lock linguist-generated=true
15+
docs/package-lock.json linguist-generated=true
16+
THIRD_PARTY_LICENSES.md linguist-generated=true
17+
18+
# Test fixtures and the documentation site are not the project's source language.
19+
tests/data/** linguist-vendored=true
20+
docs/** linguist-documentation=true

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @frenck

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
github: frenck
3+
patreon: frenck
4+
custom: https://frenck.dev/donate/
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 🐛 Bug report
2+
description: Report a problem with yamlrocks
3+
labels: [bug]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to report a bug. Please fill in the details
9+
below so it can be reproduced.
10+
11+
Using AI tools to help write this report is fine, but review and
12+
understand it yourself first. See the
13+
[AI Policy](https://github.com/frenck/yamlrocks/blob/main/AI_POLICY.md);
14+
autonomously created issues will be closed.
15+
- type: textarea
16+
id: description
17+
attributes:
18+
label: Description
19+
description: A clear description of the problem.
20+
validations:
21+
required: true
22+
- type: textarea
23+
id: reproduction
24+
attributes:
25+
label: Reproduction
26+
description: A minimal YAML input and the yamlrocks call that triggers the bug.
27+
render: python
28+
placeholder: |
29+
import yamlrocks
30+
yamlrocks.loads(b"...")
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: expected
35+
attributes:
36+
label: Expected behavior
37+
validations:
38+
required: true
39+
- type: input
40+
id: version
41+
attributes:
42+
label: yamlrocks version
43+
validations:
44+
required: true
45+
- type: input
46+
id: python
47+
attributes:
48+
label: Python version and platform
49+
validations:
50+
required: true

0 commit comments

Comments
 (0)