Skip to content
Merged
Changes from 1 commit
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
27 changes: 27 additions & 0 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ var initCmd = &cobra.Command{
if err := buildDefaultConfigurationFiles(toolsConfigDir); err != nil {
log.Fatal(err)
}
if err := createLanguagesConfigFileLocal(toolsConfigDir); err != nil {
log.Fatal(err)
}
} else {
err := buildRepositoryConfigurationFiles(initFlags.ApiToken)
if err != nil {
Expand All @@ -74,6 +77,30 @@ var initCmd = &cobra.Command{
},
}

func createLanguagesConfigFileLocal(toolsConfigDir string) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing dart?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, dart

content := `tools:
- name: semgrep
languages: [CPP, Go, Java, JavaScript, JSON, Python, Ruby]
extensions: [.cc, .cpcac, .cpp, .cxx, .gemspec, .go, .hpp, .ino, .java, .jbuilder, .js, .jsm, .json, .jssssx, .jsx, .mjs, .opal, .podspec, .py, .pyx, .rake, .rb, .vue]
- name: trivy
Copy link
Copy Markdown
Contributor

@zhamborova zhamborova May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are missing cpp, dart analyzer mappings

languages: [Multiple]
extensions: []
- name: pmd
languages: [Java, JavaScript, XML, Ruby]
extensions: [.gemspec, .java, .jbuilder, .js, .jsm, .jssssx, .jsx, .mjs, .opal, .podspec, .pom, .rake, .rb, .vue, .wsdl, .xml, .xsl]
- name: pylint
languages: [Python]
extensions: [.py]
- name: lizard
languages: [CPP, Java, JavaScript, Python, Ruby]
extensions: [.cc, .cpcac, .cpp, .cxx, .gemspec, .hpp, .ino, .java, .jbuilder, .js, .jsm, .jssssx, .jsx, .mjs, .opal, .podspec, .py, .pyx, .rake, .rb, .vue]
- name: eslint
languages: [JavaScript]
extensions: [.js, .jsm, .jsx, .mjs, .vue]`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


return os.WriteFile(filepath.Join(toolsConfigDir, "languages-config.yaml"), []byte(content), utils.DefaultFilePerms)
}

func createGitIgnoreFile() error {
gitIgnorePath := filepath.Join(config.Config.LocalCodacyDirectory(), ".gitignore")
gitIgnoreFile, err := os.Create(gitIgnorePath)
Expand Down
Loading