-
Notifications
You must be signed in to change notification settings - Fork 10
fix: crate langugages config file for local mode #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 { | ||
|
|
@@ -74,6 +77,30 @@ var initCmd = &cobra.Command{ | |
| }, | ||
| } | ||
|
|
||
| func createLanguagesConfigFileLocal(toolsConfigDir string) error { | ||
| 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typescript?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing dart?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, dart