Skip to content

Commit 3260d62

Browse files
committed
🐛 Improve linter detection from .idea
1 parent beeb964 commit 3260d62

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cmd/init.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ func NewInitCommand() *cobra.Command {
3434
Short: "Configure project for Qodana",
3535
Long: `Configure project for Qodana: prepare Qodana configuration file by analyzing the project structure and generating a default configuration qodana.yaml file.`,
3636
Run: func(cmd *cobra.Command, args []string) {
37-
core.GetLinter(options.ProjectDir)
37+
qodanaYaml := core.GetQodanaYaml(options.ProjectDir)
38+
if qodanaYaml.Linter == "" {
39+
core.GetLinter(options.ProjectDir)
40+
} else {
41+
core.EmptyMessage()
42+
core.SuccessMessage("The linter was already configured before: %s", core.PrimaryBold(qodanaYaml.Linter))
43+
}
3844
core.WarningMessage("Run %s to analyze the project. The configuration is stored in qodana.yaml and can be changed later", core.PrimaryBold("qodana scan"))
3945
},
4046
}

core/configurator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ func readIdeaDir(project string) []string {
206206
workspace := string(xml)
207207
if strings.Contains(workspace, "PhpWorkspaceProjectConfiguration") {
208208
languages = Append(languages, "PHP")
209-
} else {
209+
}
210+
if strings.Contains(workspace, "node.js.detected.package.eslint") {
210211
languages = Append(languages, "JavaScript")
211212
}
212213
}

0 commit comments

Comments
 (0)