Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring code. Moving things around for readability #264

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/support/init_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func InitConfiguration(cmd *cobra.Command) {
}

//Registers sub CommandsList
config.InitConfig(configOverride, DefaultConfig)
config.InitGdgConfig(configOverride, DefaultConfig)
appconfig.InitializeAppLogger(os.Stdout, os.Stderr, config.Config().IsDebug())

//Validate current configuration
Expand Down
2 changes: 1 addition & 1 deletion cli/test/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func InterceptStdout() (*os.File, *os.File, func()) {
backupErr := os.Stderr
r, w, _ := os.Pipe()
//Restore streams
config.InitConfig("testing", "")
config.InitGdgConfig("testing", "")
applog.InitializeAppLogger(w, w, false)
cleanup := func() {
os.Stdout = backupStd
Expand Down
4 changes: 2 additions & 2 deletions cli/tools/dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/bep/simplecobra"
"github.com/esnet/gdg/cli/support"
"github.com/esnet/gdg/internal/service"
"github.com/esnet/gdg/internal/service/types"
"github.com/spf13/cobra"
"log/slog"
)
Expand Down Expand Up @@ -45,7 +45,7 @@ func newDashboardLintCmd() simplecobra.Commander {
slog.Info("This is mainly provided as a convenience GDG, if you find yourself relying on this tool heavily, please have a look at: github.com/grafana/dashboard-linter/")
dashboard, _ := cd.CobraCommand.Flags().GetString("dashboard")
folder, _ := cd.CobraCommand.Flags().GetString("folder")
filterReq := service.LintRequest{
filterReq := types.LintRequest{
StrictFlag: lintStrictFlag,
VerboseFlag: lintVerboseFlag,
AutoFix: lintAutofixFlag,
Expand Down
2 changes: 1 addition & 1 deletion cmd/gdg-generate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func main() {
slog.Warn("unable to load default configuration, no fallback")
}

config.InitConfig(*cfgName, defaultConfiguration)
config.InitGdgConfig(*cfgName, defaultConfiguration)
config.InitTemplateConfig(*tmpCfgName)
cfg := config.Config()
appconfig.InitializeAppLogger(os.Stdout, os.Stderr, cfg.IsDebug())
Expand Down
Loading
Loading