Skip to content

Commit

Permalink
🐛 Improve linter detection from .idea
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Feb 10, 2022
1 parent beeb964 commit 3260d62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ func NewInitCommand() *cobra.Command {
Short: "Configure project for Qodana",
Long: `Configure project for Qodana: prepare Qodana configuration file by analyzing the project structure and generating a default configuration qodana.yaml file.`,
Run: func(cmd *cobra.Command, args []string) {
core.GetLinter(options.ProjectDir)
qodanaYaml := core.GetQodanaYaml(options.ProjectDir)
if qodanaYaml.Linter == "" {
core.GetLinter(options.ProjectDir)
} else {
core.EmptyMessage()
core.SuccessMessage("The linter was already configured before: %s", core.PrimaryBold(qodanaYaml.Linter))
}
core.WarningMessage("Run %s to analyze the project. The configuration is stored in qodana.yaml and can be changed later", core.PrimaryBold("qodana scan"))
},
}
Expand Down
3 changes: 2 additions & 1 deletion core/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ func readIdeaDir(project string) []string {
workspace := string(xml)
if strings.Contains(workspace, "PhpWorkspaceProjectConfiguration") {
languages = Append(languages, "PHP")
} else {
}
if strings.Contains(workspace, "node.js.detected.package.eslint") {
languages = Append(languages, "JavaScript")
}
}
Expand Down

0 comments on commit 3260d62

Please sign in to comment.