Skip to content

Commit c37dcc3

Browse files
committed
chore: lint fixes
1 parent 1b793cb commit c37dcc3

3 files changed

Lines changed: 13 additions & 22 deletions

File tree

internal/cli/quickstart_detect.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ func DetectProject(dir string) DetectionResult {
7676
if data, ok := readFileContent(dir, "pubspec.yaml"); ok {
7777
if strings.Contains(data, "sdk: flutter") {
7878
result.Detected = true
79-
// android/ or ios/ present means a native project regardless of web/ directory.
80-
// flutter create (default) has included web/ since Flutter 2.10, so web/ alone
79+
// Flutter create (default) has included web/ since Flutter 2.10, so web/ alone
8180
// is not a reliable signal for web-only intent.
8281
if dirExists(dir, "android") || dirExists(dir, "ios") {
8382
result.Framework = "flutter"
@@ -161,8 +160,7 @@ func DetectProject(dir string) DetectionResult {
161160
return result
162161
}
163162

164-
// ── 10. Expo: app.json with top-level "expo" key, or legacy expo.json ────.
165-
// create-expo-app has generated app.json (not expo.json) since SDK 46 (2022).
163+
// Create-expo-app has generated app.json (not expo.json) since SDK 46 (2022).
166164
// Check app.json first; fall back to expo.json for legacy projects.
167165
if isExpoProject(dir) || fileExists(dir, "expo.json") {
168166
result.Framework = "expo"
@@ -320,16 +318,15 @@ func detectJavaFramework(content string) (framework string, port int) {
320318
strings.Contains(lower, "jakarta.ee") ||
321319
strings.Contains(lower, "javax.servlet") ||
322320
strings.Contains(lower, "jakarta.servlet") ||
323-
// jakarta.platform:jakarta.jakartaee-api is the standard BOM for Jakarta EE 9+.
321+
// Jakarta.platform:jakarta.jakartaee-api is the standard BOM for Jakarta EE 9+.
324322
strings.Contains(lower, "jakarta.platform"):
325323
return "java-ee", 0
326324
default:
327325
return "vanilla-java", 0
328326
}
329327
}
330328

331-
// isExpoProject returns true if app.json contains a top-level "expo" key.
332-
// create-expo-app has generated app.json (not expo.json) since SDK 46 in 2022.
329+
// Create-expo-app has generated app.json (not expo.json) since SDK 46 in 2022.
333330
func isExpoProject(dir string) bool {
334331
data, err := os.ReadFile(filepath.Join(dir, "app.json"))
335332
if err != nil {
@@ -349,13 +346,6 @@ func dirExists(dir, name string) bool {
349346
return err == nil && info.IsDir()
350347
}
351348

352-
// isFlutterWeb returns true if the project has web platform support enabled.
353-
// Kept for backwards compatibility; DetectProject uses dirExists for android/ios instead.
354-
func isFlutterWeb(dir string) bool {
355-
_, err := os.Stat(filepath.Join(dir, "web", "index.html"))
356-
return err == nil
357-
}
358-
359349
// fileExists returns true if the named file exists in dir.
360350
func fileExists(dir, name string) bool {
361351
_, err := os.Stat(filepath.Join(dir, name))

internal/cli/quickstart_detect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func TestDetectProject_Laravel(t *testing.T) {
469469
func TestDetectProject_Flutter(t *testing.T) {
470470
dir := t.TempDir()
471471
writeTestFile(t, dir, "pubspec.yaml", "name: my_flutter_app\nflutter:\n sdk: flutter\n")
472-
// android/ present -> native (reliable signal for native intent).
472+
// Android/ present -> native (reliable signal for native intent).
473473
mkTestDir(t, dir, "android")
474474

475475
got := DetectProject(dir)

internal/cli/quickstarts.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ func setupQuickstartCmdExperimental(cli *cli) *cobra.Command {
709709
return fmt.Errorf("authentication required: %w", err)
710710
}
711711

712-
// linkedAppClientID tracks which app client ID to link to the API
712+
// LinkedAppClientID tracks which app client ID to link to the API
713713
// (either a newly created app or one selected from the tenant).
714714
var linkedAppClientID string
715715

@@ -747,12 +747,13 @@ func setupQuickstartCmdExperimental(cli *cli) *cobra.Command {
747747
typeFromFlag := cmd.Flags().Changed("type")
748748
frameworkFromFlag := cmd.Flags().Changed("framework")
749749

750-
if typeFromFlag && frameworkFromFlag {
750+
switch {
751+
case typeFromFlag && frameworkFromFlag:
751752
// User explicitly specified type and framework via flags; skip detection UI.
752753
if inputs.Name == "" {
753754
inputs.Name = detection.AppName
754755
}
755-
} else if detection.Detected {
756+
case detection.Detected:
756757
if len(detection.AmbiguousCandidates) > 1 {
757758
// Multiple package.json deps matched — show partial summary and ask user to disambiguate.
758759
cli.renderer.Infof("Detected in current directory")
@@ -815,7 +816,7 @@ func setupQuickstartCmdExperimental(cli *cli) *cobra.Command {
815816
}
816817
}
817818
}
818-
} else {
819+
default:
819820
// No detection signal found — notify the user and pre-fill name from directory.
820821
cli.renderer.Warnf("Auto detection Failed: Unable to auto detect application")
821822
if inputs.Name == "" {
@@ -916,8 +917,7 @@ func setupQuickstartCmdExperimental(cli *cli) *cobra.Command {
916917
}
917918
}
918919

919-
// Prompt for token lifetime if not provided via flag.
920-
// inputs.TokenLifetime already has "86400" from flag default; only prompt interactively.
920+
// Inputs.TokenLifetime already has "86400" from flag default; only prompt interactively.
921921
if !cmd.Flags().Changed("token-lifetime") && canPrompt(cmd) {
922922
defaultLifetime := "86400"
923923
q := prompt.TextInput("token-lifetime", "Access token lifetime (seconds)", "How long access tokens remain valid (default: 86400 = 24 hours)", defaultLifetime, true)
@@ -951,7 +951,8 @@ func setupQuickstartCmdExperimental(cli *cli) *cobra.Command {
951951
named = append(named, name)
952952
appIDByName[name] = c.GetClientID()
953953
}
954-
appOptions = append(named, "Skip")
954+
named = append(named, "Skip")
955+
appOptions = named
955956
}
956957

957958
var selectedAppName string

0 commit comments

Comments
 (0)