From 6db7218093e49f5e5b19c9776a184e2578fcbab5 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Fri, 31 Dec 2021 17:13:16 +0100 Subject: [PATCH] doc: Some more dev infomration --- doc/dev.md | 19 +++++++++++++++---- doc/usage.md | 4 ++-- pkg/decode/decode_gen.go | 2 +- pkg/decode/decode_gen.go.tmpl | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/doc/dev.md b/doc/dev.md index 1ed8f1ad..2e79d312 100644 --- a/doc/dev.md +++ b/doc/dev.md @@ -1,6 +1,7 @@ # Implementation details - fq uses a gojq fork that can be found at https://github.com/wader/gojq/tree/fq (the "fq" branch) +- fq uses a readline fork that can be found at https://github.com/wader/readline/tree/fq (the "fq" branch) - cli readline uses raw mode so blocks ctrl-c to become a SIGINT ## Decoder implementation help @@ -21,15 +22,25 @@ Flags can be struct with bit-fields. - Split into multiple sub formats if possible. Makes it possible to use them separately. - Validate/Assert - Error/Fatal/panic -- Is format probeable or not? +- Is format probeable or not - Can new formats be added to other formats +- Does the new format include existing formats + +Run `make doc` generate some of the documentation (requires ffmpeg and graphviz). + +Run `make lint` to lint source code. + +TODO: `make fuzz` ## Tests -Write new actual output: ```sh -make actual # write all actual outputs -WRITE_ACTUAL=1 go run -run ... # write only specific tests +# run all tests for one format +go test -run TestFQTests/mp4 ./format/ +# write all actual outputs +make actual +# write for specific tests +WRITE_ACTUAL=1 go run -run ... ``` ## Debug diff --git a/doc/usage.md b/doc/usage.md index bb73c3c5..38ef957f 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -250,10 +250,10 @@ fq can be used as a scrip interpreter: - [gojq's differences to jq](https://github.com/itchyny/gojq#difference-to-jq), notable is support for arbitrary-precision integers. - Supports hexdecimal `0xab`, octal `0o77` and binary `0b101` integer literals. -- Has bitwise operations, `band`, `bor`, `bxor`, `bsl`, `bsr`, `bnot`. +- Has bitwise operators, `band`, `bor`, `bxor`, `bsl`, `bsr`, `bnot`. - Try include `include "file?";` that don't fail if file is missing. - Some values can act as a object with keys even when it's an array, number etc. -- There can be keys hidden from `keys` and `[]`. Used for, `_format`, `_bytes` etc. +- There can be keys hidden from `keys` and `[]`. - Some values are readonly and can't be updated. ## Functions diff --git a/pkg/decode/decode_gen.go b/pkg/decode/decode_gen.go index c3f86e6e..e5c221e8 100644 --- a/pkg/decode/decode_gen.go +++ b/pkg/decode/decode_gen.go @@ -1,4 +1,4 @@ -// Code below generated from scalar_gen.go.tmpl +// Code below generated from decode_gen.go.tmpl package decode import ( diff --git a/pkg/decode/decode_gen.go.tmpl b/pkg/decode/decode_gen.go.tmpl index 4126078e..c10c3d5c 100644 --- a/pkg/decode/decode_gen.go.tmpl +++ b/pkg/decode/decode_gen.go.tmpl @@ -1,4 +1,4 @@ -// Code below generated from scalar_gen.go.tmpl +// Code below generated from decode_gen.go.tmpl package decode import (