goaltools / goal

Goal is a toolkit for high productivity web development in Go language in the spirit of Revel Framework that is built around the concept of code generation.
BSD 2-Clause "Simplified" License
87 stars 3 forks source link

A new format of task runner's configuration file #4

Closed ghost closed 8 years ago

ghost commented 9 years ago

Goal's run tool uses YAML for its configuration file. The file is described here. However, I'd like to replace it by something else. I want all code including dependencies to meet the following requirements (apart from the general quality of the library):

  1. gofmt-ed with -s flag;
  2. golint-ed
  3. checked with go vet. go-yaml doesn't meet those requirements and that is the only Go implementation of YAML that is active and maintained.

I have played with different formats. Not sure about XML. But JSON doesn't work, comments are not supported and the whole config looks very difficult to read and understand with all those ", ,, and {} that could be omitted. It is also possible to use a custom format. Here is one I have developed right for this use-case.

davidhunterxyz commented 9 years ago

I like the idea of this and I think espresso looks nice

davidhunterxyz commented 9 years ago

The good thing about using YAML is that their is not much effort in using it

ghost commented 8 years ago

I'm working on the task runner now. I have decided to replace go-yaml by go-gypsy. It is not fully compatable with the 1.2 (or even 1.1) standard but it meets the requirements I've mentioned above and provides the features we need.

I'm also thinking about replacement of the current format:

init:
  - go build ./
  - /start xxx
  - /single zzz
  - /echo "smth"
xxx:
  - go test ./
zzz: ./bin/run

By the following one:

init:
  - run: "go build ./"
  - exec: xxx
  - exec: zzz
  - echo: "smth"
cmds:
  xxx:
    - {run: "go test ./", async: true}
  zzz:
    - single: "./bin/run"

I.e. YAML syntax is used instead of custom /cmdName constructions. @DavidHunter what do you think about the change? IMO it decreases readability of the configuration file (though I expected the opposite).

davidhunterxyz commented 8 years ago

I think the current one is easier to read

ghost commented 8 years ago

I've only slightly changed the format for consistency of /single with /run and /start, and replaced go-yaml by go-gypsy (#33). I'm closing this issue, we'll reopen it if a better format / parser is found.