Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export CC=gcc
use guix

8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Validate your work: `make check`.
Use Test Driven Development practices. Refactor using Red Green Refactor loops.
Code MUST be simple, minimal and readable.
Avoid duplicating code as much as you can.
Run cargo commands with the `CC=gcc` environment variable.
When editing YAML, preserve comments and blank lines around untouched keys.
Touched keys may be replaced with remove/add semantics, even if their comments are lost.
The tools MUST NEVER reformat a YAML file when editing it.
165 changes: 165 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ serde_yaml = "0.9"
regex = "1"
serde_json = "1"
termsize = "0.1"
yamlpatch = "0.12"
yamlpath = "0.34"
subfeature = "0.0.4"
thiserror = "2"
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.PHONY: check

build:
CC=gcc cargo build

test:
CC=gcc cargo test

lint:
CC=gcc cargo clippy -- -D warnings

check: test lint
cargo fmt --check
CC=gcc cargo clippy -- -D warnings

.DEFAULT_GOAL := check
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ cargo build --release
$ ym cp tests/data/config-prod.yaml:database.primary.password tests/data/app-config.yaml:database.secondary.password

$ # Copy value from source.key to destination.key (same file, destination file is optional and defaults to source file)
$ ym cp tests/data/app-config.yaml:database.primary.password database.replica.password
$ ym cp tests/data/app-config.yaml:database.primary.password :database.replica.password

$ # Copy value to a different file (with same key, destination key is optional and defaults to source key)
$ ym cp tests/data/app-config.yaml:app.name tests/data/config-prod.yaml:
$ ym cp tests/data/app-config.yaml:app.name tests/data/config-prod.yaml
```

- use **mv** to move a value from one key to another (copies then deletes the source):
Expand All @@ -52,8 +52,8 @@ cargo build --release
$ ym mv tests/data/config-prod.yaml:database.primary.password tests/data/app-config.yaml:database.secondary.password

$ # Move value from source.key to destination.key (same file, destination file is optional and defaults to source file)
$ ym mv tests/data/app-config.yaml:database.primary.password database.replica.password
$ ym mv tests/data/app-config.yaml:database.primary.password :database.replica.password

$ # Move value to a different file (with same key, destination key is optional and defaults to source key)
$ ym mv tests/data/app-config.yaml:app.name tests/data/config-prod.yaml:
$ ym mv tests/data/app-config.yaml:app.name tests/data/config-prod.yaml
```
Loading