-
Notifications
You must be signed in to change notification settings - Fork 10
fix: Only pass configuration file if created, otherwise fallback to native tool PLUTO-1383 #60
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
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 |
eadba8d to
dceec5a
Compare
…ative tool PLUTO-1383 Still needs updates on PMD
dceec5a to
278f68d
Compare
If a config file is generated (exists inside the .codacy) then rely on it It also updates PMD to receive the configuration to be able to test it
|
|
||
| func (c *ConfigType) setupCodacyPaths() { | ||
| c.globalCacheDirectory = filepath.Join(c.homePath, ".cache", "codacy") | ||
| func NewConfigType(repositoryDirectory string, repositoryCache string, globalCache string) *ConfigType { |
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.
Created a builder, so it can used both on the Global initialization and tests
| return c | ||
| } | ||
|
|
||
| // TODO: Consider not having a global config and instead pass the config object around |
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.
For now, let's keep it, but it is now easier to remove, as it only depends at the NewConfigType method to generate the values for the config
| // Returns: | ||
| // - string: The relative path to the configuration file (for cmd args) | ||
| // - bool: True if the file exists, false otherwise | ||
| func ConfigFileExists(conf config.ConfigType, fileName string) (string, bool) { |
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.
Each tool runner should now depend on this when generating its command to pass a configuration file
The tools now should rely on the ConfigFileExists at configUtils to check and propagate the correct configuration file. That method will give preference to the generated file