From 487176698565b2ac983ef574d0c69028309589f9 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 3 Apr 2024 16:20:10 +0200 Subject: [PATCH] Add `air` config for debugging --- .air.toml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 54 insertions(+) create mode 100644 .air.toml diff --git a/.air.toml b/.air.toml new file mode 100644 index 00000000..a501c1f4 --- /dev/null +++ b/.air.toml @@ -0,0 +1,53 @@ +root = "." +testdata_dir = "testdata" +tmp_dir = "tmp" + +[build] +args_bin = [] +bin = "./tmp/main" +cmd = "go generate ./... && go build -o ./tmp/main main.go" +delay = 1000 +exclude_dir = ["assets", "build", "tmp", "vendor", "test", "testdata"] +exclude_file = ["server/admin/assets/dist.css"] +exclude_regex = [ + "_test\\.go", + "_templ\\.go", + "\\.sql\\.go", + ".*models/(models|copyfrom|db).go", + "cmd/datamaps", +] +exclude_unchanged = false +follow_symlink = false +# contrary to other repos, this does wait for the debugger to attach, as cli processes are very shortlived +full_bin = "dlv exec --accept-multiclient --log --headless --listen :9087 --api-version 2 ./tmp/main --" +include_dir = [] +include_ext = ["go", "tpl", "tmpl", "templ", "html", "sql", "css", "md"] +include_file = ["sqlc.yaml"] +kill_delay = "0s" +log = "build-errors.log" +poll = false +poll_interval = 0 +post_cmd = [] +pre_cmd = [] +rerun = false +rerun_delay = 500 +send_interrupt = false +stop_on_error = true + +[color] +app = "" +build = "yellow" +main = "magenta" +runner = "green" +watcher = "cyan" + +[log] +main_only = false +time = false + +[misc] +clean_on_exit = false + +[screen] +clear_on_rebuild = false +keep_scroll = true diff --git a/.gitignore b/.gitignore index 6b911198..717371ce 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ output .DS_Store .terraform overmind.plan +/tmp/