Move FORMAT.md to docs/ and contrib/ to bin/, fix bash script style (closes #74)
check / check (push) Failing after 3s
check / check (push) Failing after 3s
FORMAT.md moves to docs/ and every reference follows; its two relative links to mfer/mf.proto now point up one directory, its text is otherwise unchanged. contrib/usage.sh moves to bin/, not docs/: it is a script you run (it builds mfer, then generates and checks a manifest of the repo), not reading material. Both scripts now use #!/usr/bin/env bash, set -euo pipefail and a main function. bin/gitrev.sh still exits non-zero outside a git checkout, so the Makefile still falls back to unknown. .gitignore now ignores only the built bin/mfer rather than all of bin/, which holds tracked scripts. Model: opus-5-5
This commit was merged in pull request #148.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
/bin/
|
||||
/bin/mfer
|
||||
/tmp
|
||||
/node_modules/
|
||||
*.tmp
|
||||
|
||||
@@ -26,7 +26,7 @@ source for coding standards, formatting, linting, and workflow rules.
|
||||
- This is a Go library + CLI tool for generating `.mf` manifest files.
|
||||
- The proto definition is in `mfer/mf.proto`; generated `.pb.go` files are
|
||||
committed (required for `go get` compatibility).
|
||||
- The format specification is in `FORMAT.md`.
|
||||
- The format specification is in `docs/FORMAT.md`.
|
||||
- Open work, open design questions included, is tracked only in the repo's
|
||||
issues: https://git.eeqj.de/sneak/mfer/issues. There is no `TODO.md` and no
|
||||
TODO list in `README.md`; do not add either. For this repo this overrides the
|
||||
|
||||
@@ -242,7 +242,7 @@ are now tracked only in the [issues](https://git.eeqj.de/sneak/mfer/issues).
|
||||
as question 10 on [issue 82](https://git.eeqj.de/sneak/mfer/issues/82).
|
||||
|
||||
- Should the on-disk serialization format be proto3 or json? Settled: it is
|
||||
proto3, see `FORMAT.md` and `mfer/mf.proto`.
|
||||
proto3, see `docs/FORMAT.md` and `mfer/mf.proto`.
|
||||
|
||||
# Tool Examples
|
||||
|
||||
|
||||
+11
-6
@@ -1,7 +1,12 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
if [[ ! -z "$GITREV" ]]; then
|
||||
echo $GITREV
|
||||
else
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
if [[ -n "${GITREV:-}" ]]; then
|
||||
echo "$GITREV"
|
||||
else
|
||||
git describe --tags --always --dirty=-dirty
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# usage.sh - Generate and check a manifest from the repo
|
||||
# Run from repo root: bin/usage.sh
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$TMPDIR"
|
||||
}
|
||||
|
||||
main() {
|
||||
TMPDIR=$(mktemp -d)
|
||||
MANIFEST="$TMPDIR/index.mf"
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Building mfer..."
|
||||
go build -o "$TMPDIR/mfer" ./cmd/mfer
|
||||
|
||||
"$TMPDIR/mfer" generate -o "$MANIFEST" .
|
||||
"$TMPDIR/mfer" check --base . "$MANIFEST"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# usage.sh - Generate and check a manifest from the repo
|
||||
# Run from repo root: ./contrib/usage.sh
|
||||
|
||||
TMPDIR=$(mktemp -d)
|
||||
MANIFEST="$TMPDIR/index.mf"
|
||||
|
||||
cleanup() {
|
||||
rm -rf "$TMPDIR"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Building mfer..."
|
||||
go build -o "$TMPDIR/mfer" ./cmd/mfer
|
||||
|
||||
"$TMPDIR/mfer" generate -o "$MANIFEST" .
|
||||
"$TMPDIR/mfer" check --base . "$MANIFEST"
|
||||
@@ -19,7 +19,7 @@ An `.mf` file consists of two parts, concatenated:
|
||||
There is no length prefix or version byte between the magic and the protobuf
|
||||
message. The protobuf message extends to the end of the file.
|
||||
|
||||
See [`mfer/mf.proto`](mfer/mf.proto) for exact field numbers and types.
|
||||
See [`mfer/mf.proto`](../mfer/mf.proto) for exact field numbers and types.
|
||||
|
||||
## Outer Message (`MFFileOuter`)
|
||||
|
||||
@@ -143,6 +143,6 @@ The recommended MIME type for `.mf` files is `application/octet-stream`. The
|
||||
|
||||
## Reference
|
||||
|
||||
- Proto definition: [`mfer/mf.proto`](mfer/mf.proto)
|
||||
- Proto definition: [`mfer/mf.proto`](../mfer/mf.proto)
|
||||
- Reference implementation:
|
||||
[git.eeqj.de/sneak/mfer](https://git.eeqj.de/sneak/mfer)
|
||||
Reference in New Issue
Block a user