Skip to content

Commit 9ab2a44

Browse files
committed
Fixes linter issues
1 parent 1c253e6 commit 9ab2a44

File tree

8 files changed

+53
-13
lines changed

8 files changed

+53
-13
lines changed

cli/azd/.vscode/cspell-azd-dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ eventhubs
110110
executil
111111
flexconsumption
112112
Frontends
113+
fsnotify
113114
funcapp
114115
functestapp
115116
functionapp

cli/azd/extensions/microsoft.azd.extensions/internal/cmd/build.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ func newBuildCommand() *cobra.Command {
4848
},
4949
}
5050

51-
buildCmd.Flags().StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
52-
buildCmd.Flags().StringVarP(&flags.outputPath, "output", "o", "", "Path to the output directory. Defaults to relative /bin folder.")
53-
buildCmd.Flags().BoolVar(&flags.allPlatforms, "all", false, "When set builds for all os/platforms. Defaults to the current os/platform only.")
54-
buildCmd.Flags().BoolVar(&flags.skipInstall, "skip-install", false, "When set skips reinstalling extension after successful build.")
51+
buildCmd.Flags().
52+
StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
53+
buildCmd.Flags().
54+
StringVarP(&flags.outputPath, "output", "o", "", "Path to the output directory. Defaults to relative /bin folder.")
55+
buildCmd.Flags().
56+
BoolVar(&flags.allPlatforms, "all", false, "When set builds for all os/platforms. Defaults to the current os/platform only.")
57+
buildCmd.Flags().
58+
BoolVar(&flags.skipInstall, "skip-install", false, "When set skips reinstalling extension after successful build.")
5559

5660
return buildCmd
5761
}

cli/azd/extensions/microsoft.azd.extensions/internal/cmd/init.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ func collectExtensionMetadata(ctx context.Context, azdClient *azdext.AzdClient)
280280
}, nil
281281
}
282282

283-
func createExtensionDirectory(ctx context.Context, azdClient *azdext.AzdClient, extensionMetadata *models.ExtensionSchema) error {
283+
func createExtensionDirectory(
284+
ctx context.Context,
285+
azdClient *azdext.AzdClient,
286+
extensionMetadata *models.ExtensionSchema,
287+
) error {
284288
cwd, err := os.Getwd()
285289
if err != nil {
286290
return fmt.Errorf("failed to get current working directory: %w", err)
@@ -292,7 +296,10 @@ func createExtensionDirectory(ctx context.Context, azdClient *azdext.AzdClient,
292296
if err == nil && info.IsDir() {
293297
azdClient.Prompt().Confirm(ctx, &azdext.ConfirmRequest{
294298
Options: &azdext.ConfirmOptions{
295-
Message: fmt.Sprintf("The extension directory '%s' already exists. Do you want to continue?", extensionMetadata.Id),
299+
Message: fmt.Sprintf(
300+
"The extension directory '%s' already exists. Do you want to continue?",
301+
extensionMetadata.Id,
302+
),
296303
DefaultValue: internal.ToPtr(false),
297304
},
298305
})

cli/azd/extensions/microsoft.azd.extensions/internal/cmd/package.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ func newPackageCommand() *cobra.Command {
5353
},
5454
}
5555

56-
packageCmd.Flags().StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
57-
packageCmd.Flags().StringVarP(&flags.registryPath, "registry", "r", "", "Path to the registry.json file. If not provided, will use a local registry.")
58-
packageCmd.Flags().StringVarP(&flags.outputPath, "output", "o", "", "Path to the artifacts output directory. If not provided, will use local registry")
59-
packageCmd.Flags().StringVarP(&flags.basePath, "base-path", "b", "", "Base path for artifact paths. If not provided, will use local relative paths.")
56+
packageCmd.Flags().
57+
StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
58+
packageCmd.Flags().
59+
StringVarP(&flags.registryPath, "registry", "r", "", "Path to the registry.json file. If not provided, will use a local registry.")
60+
packageCmd.Flags().
61+
StringVarP(&flags.outputPath, "output", "o", "", "Path to the artifacts output directory. If not provided, will use local registry")
62+
packageCmd.Flags().
63+
StringVarP(&flags.basePath, "base-path", "b", "", "Base path for artifact paths. If not provided, will use local relative paths.")
6064

6165
return packageCmd
6266
}
@@ -176,7 +180,12 @@ func runPackageAction(flags *packageFlags) error {
176180
return nil
177181
}
178182

179-
func processExtension(extensionMetadata *models.ExtensionSchema, outputPath string, baseURL string, registry *extensions.Registry) error {
183+
func processExtension(
184+
extensionMetadata *models.ExtensionSchema,
185+
outputPath string,
186+
baseURL string,
187+
registry *extensions.Registry,
188+
) error {
180189
// Prepare artifacts for registry
181190
artifactsPath := filepath.Join(extensionMetadata.Path, "bin")
182191
artifacts, err := os.ReadDir(artifactsPath)
@@ -218,7 +227,13 @@ func processExtension(extensionMetadata *models.ExtensionSchema, outputPath stri
218227
}
219228

220229
// Generate URL for the artifact using the base URL
221-
url := fmt.Sprintf("%s/%s/%s/%s", baseURL, extensionMetadata.Id, extensionMetadata.Version, filepath.Base(targetFilePath))
230+
url := fmt.Sprintf(
231+
"%s/%s/%s/%s",
232+
baseURL,
233+
extensionMetadata.Id,
234+
extensionMetadata.Version,
235+
filepath.Base(targetFilePath),
236+
)
222237

223238
platformMetadata := map[string]any{
224239
"entryPoint": artifact.Name(),

cli/azd/extensions/microsoft.azd.extensions/internal/cmd/watch.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
package cmd
25

36
import (
@@ -39,7 +42,8 @@ func newWatchCommand() *cobra.Command {
3942
},
4043
}
4144

42-
watchCmd.Flags().StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
45+
watchCmd.Flags().
46+
StringVarP(&flags.extensionPath, "path", "p", ".", "Paths to the extension directory. Defaults to the current directory.")
4347

4448
return watchCmd
4549
}

cli/azd/extensions/microsoft.azd.extensions/internal/models/extension_schema.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
package models
25

36
import (

cli/azd/extensions/microsoft.azd.extensions/internal/util.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
package internal
25

36
import "os"

cli/azd/extensions/microsoft.azd.extensions/internal/ux.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
14
package internal
25

36
import (

0 commit comments

Comments
 (0)