phase2 / rig

Outrigger command line tool
MIT License
11 stars 8 forks source link

Refactor project scripts into cleaner API. #157

Closed grayside closed 6 years ago

grayside commented 6 years ago

Some refactoring to enable rig project doctor, replacing the existing long-standing PR later today I expect.

grayside commented 6 years ago

Heh, finding gometalinter started doing unpredictable stuff locally (scanning dependencies and so on). Will address these errors:

23.59s$ gometalinter --vendor --deadline=60s --config=gometalinter.json ./...
commands/project_eval.go:50::warning: Subprocess launching with variable.,HIGH,HIGH (gas)
commands/project_eval.go:52::warning: Subprocess launching with variable.,HIGH,HIGH (gas)
commands/project.go:85:16:warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
commands/project_config.go:17:9:warning: struct field Id should be ID (golint)
commands/project_eval.go:13:6:warning: exported type ProjectEval should have comment or be unexported (golint)
grayside commented 6 years ago

I took the Script/ProjectScript approach, there is a need for two different structs: one of them is initialized with project config and the logger and operates as a "runner" service for a Script. This ended up be a fairly minimal change.