-
Notifications
You must be signed in to change notification settings - Fork 1
Pluto 1382 change tools configs location #59
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
Conversation
- Added cli-v2 and cli-config.yaml to .gitignore. - Downgraded ESLint version in codacy.yaml from 9.3.0 to 8.57.0. - Updated file creation paths in init.go to use localCodacyDir for ESLint, Trivy, and PMD configuration files, ensuring they are saved in the correct directory.
- Removed cli-config.yaml from the repository and updated .gitignore accordingly. - Added ESLint and Trivy configuration files to the tools-configs directory. - Modified ESLint and Trivy runner functions to utilize the new configuration files. - Cleaned up PMD runner to default to the new ruleset configuration if none is specified.
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.
Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.
Files not reviewed (2)
- .codacy/cli-config.yaml: Language not supported
- tools/testdata/repositories/test1/expected.sarif: Language not supported
Comments suppressed due to low confidence (3)
tools/trivyRunner.go:14
- Consider using the ToolsConfigDirectory accessor from the config package instead of hardcoding '.codacy/tools-configs', to ensure consistency if the directory path ever needs to change.
configFile := filepath.Join(".codacy", "tools-configs", "trivy.yaml")
tools/pmdRunner.go:27
- Consider retrieving the tools configuration directory via the config package rather than hardcoding '.codacy/tools-configs' here, to improve consistency across the codebase.
configFile := filepath.Join(".codacy", "tools-configs", "pmd-ruleset.xml")
tools/eslintRunner.go:23
- Consider using the config package's ToolsConfigDirectory accessor here in place of the hardcoded '.codacy/tools-configs', to centralize configuration path management.
configFile := filepath.Join(".codacy", "tools-configs", "eslint.config.mjs")
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
cmd/init.go
Outdated
toolsConfigDir := config.Config.ToolsConfigDirectory() | ||
|
||
// Create tools-configs directory if it doesn't exist | ||
if err := os.MkdirAll(toolsConfigDir, 0777); err != nil { |
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.
Trying to give less permission seems cool
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.
done, added constants
cmd := exec.Command(pmdBinary, "pmd") | ||
|
||
// Add config file from tools-configs directory if not specified | ||
if rulesetFile == "" { |
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.
I see that we pass always ""
is this a WIP, or suppose to be like this on the scope of this PR? I see you removed a setting witch was PMD only (which makes sense for me to be removed). So maybe we don't even want this argument if this if
is just a fake?
Meaning, instead of deciding this here, assuming that we were passing some kind of default, is to generate a file with the defaults as needed?
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.
Not always, in test I use a specific file and In this case it's ok.
Generally, If in future we want to be able to pass smth like analyze --config xyz.file
- like ovveride, then it can stay.
If not we can delete 🤷♂️
- Implemented a function to create a .gitignore file during the initialization of Codacy configuration. - Updated .gitignore to include cli-v2 and removed unnecessary entries. - Ensured the .gitignore file contains relevant entries for Codacy CLI tools.
- Updated file creation functions to use `utils.DefaultRW` for read/write permissions instead of hardcoded values. - Ensured consistency in permission settings across PMD and Trivy configuration file creation.
No description provided.