feat: add pre-commit hooks & refactor code to pass linting
This commit is contained in:
@ -9,10 +9,6 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
const TaskcafeConfDirEnvName = "TASKCAFE_CONFIG_DIR"
|
||||
|
||||
const TaskcafeAppConf = "taskcafe"
|
||||
|
||||
const mainDescription = `Taskcafé is an open soure project management
|
||||
system written in Golang & React.`
|
||||
|
||||
@ -26,10 +22,6 @@ var versionTemplate = fmt.Sprintf(`Version: %s
|
||||
Commit: %s
|
||||
Built: %s`, version, commit, date+"\n")
|
||||
|
||||
var commandError error
|
||||
var configDir string
|
||||
var verbose bool
|
||||
var noColor bool
|
||||
var cfgFile string
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
@ -69,6 +61,7 @@ func initConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the root cobra command
|
||||
func Execute() {
|
||||
rootCmd.SetVersionTemplate(versionTemplate)
|
||||
rootCmd.AddCommand(newWebCmd(), newMigrateCmd(), newTokenCmd())
|
||||
|
@ -3,8 +3,6 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jordanknott/taskcafe/internal/migrations"
|
||||
)
|
||||
|
||||
|
@ -8,16 +8,17 @@ import (
|
||||
|
||||
"github.com/golang-migrate/migrate/v4"
|
||||
"github.com/golang-migrate/migrate/v4/database/postgres"
|
||||
_ "github.com/golang-migrate/migrate/v4/source/file"
|
||||
"github.com/golang-migrate/migrate/v4/source/httpfs"
|
||||
"github.com/jmoiron/sqlx"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// MigrateLog is a logger for go migrate
|
||||
type MigrateLog struct {
|
||||
verbose bool
|
||||
}
|
||||
|
||||
// Printf logs to logrus
|
||||
func (l *MigrateLog) Printf(format string, v ...interface{}) {
|
||||
log.Printf("%s", v)
|
||||
}
|
||||
|
@ -2,14 +2,14 @@ package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/golang-migrate/migrate/v4"
|
||||
"github.com/golang-migrate/migrate/v4/database/postgres"
|
||||
_ "github.com/golang-migrate/migrate/v4/source/file"
|
||||
"github.com/golang-migrate/migrate/v4/source/httpfs"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/jordanknott/taskcafe/internal/route"
|
||||
|
Reference in New Issue
Block a user