Skip to content

add dart analyzer #56

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

Merged
merged 21 commits into from
Apr 15, 2025
Merged

add dart analyzer #56

merged 21 commits into from
Apr 15, 2025

Conversation

heliocodacy
Copy link
Contributor

No description provided.

hjrocha and others added 5 commits April 4, 2025 12:05
* feature: improve starting from zero UX
* ux: update API token instructions in welcome message
* chore: update GitHub Actions workflow to initialize cli-v2 and remove Windows support
* feature: installation progress bar
* feature: enhance installation checks and user feedback
* refactor: update configuration handling and directory creation
Copy link

codacy-production bot commented Apr 4, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+1.39% 60.57%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (054c857) 2653 864 32.57%
Head commit (30efdfd) 2815 (+162) 956 (+92) 33.96% (+1.39%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#56) 175 106 60.57%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Copy link
Member

@machadoit machadoit left a comment

Choose a reason for hiding this comment

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

@heliocodacy there was a sync about the token on the analyze command. And the decision moving forward, is to have the token as input only for the init command.

So consider removing the configuration part from this PR, so we can focus on merge the installation and running. Or focus the configuration on being created during the init with the api-token

Co-authored-by: Joao Machado <13315199+machadoit@users.noreply.github.com>
@alerizzo alerizzo requested a review from Copilot April 7, 2025 14:58
Copy link

@Copilot Copilot AI left a 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 11 changed files in this pull request and generated 2 comments.

Comment on lines +158 to +160
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
cmd.Run()
Copy link
Preview

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

The command is executed twice in the SARIF branch: once to capture output and again after writing the SARIF file. This may lead to duplicated execution or unexpected behavior; consider refactoring to run the command only once and reuse the captured output.

Suggested change
cmd.Stderr = os.Stderr
cmd.Stdout = os.Stdout
cmd.Run()
// Reuse the captured output, no need to run the command again

Copilot uses AI. Check for mistakes.

@@ -122,21 +122,32 @@ func ProcessTools(configs []ToolConfig, toolDir string) (map[string]*ToolInfo, e
if err != nil {
return nil, fmt.Errorf("error reading plugin.yaml for %s: %w", config.Name, err)
}

fmt.Println("Plugin path", pluginPath)
Copy link
Preview

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

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

[nitpick] This debug print appears to be left in production code. Consider removing or replacing it with proper logging if necessary.

Suggested change
fmt.Println("Plugin path", pluginPath)
log.Printf("Plugin path: %s", pluginPath)

Copilot uses AI. Check for mistakes.

hjrocha and others added 5 commits April 10, 2025 14:22
* feature: improve starting from zero UX
* ux: update API token instructions in welcome message
* chore: update GitHub Actions workflow to initialize cli-v2 and remove Windows support
* feature: installation progress bar
* feature: enhance installation checks and user feedback
* refactor: update configuration handling and directory creation
@hjrocha hjrocha force-pushed the feature/add-dartanalyzer branch from 2ce5d9e to c97592d Compare April 11, 2025 15:33

// Check if any config file exists
configExists := false
for _, configFile := range configFiles {
Copy link
Member

Choose a reason for hiding this comment

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

We discussed that you can rely on the ConfigFileExists that is tested and looks for files both on the .codacy/configs/ folder and root.

Not the biggest fan, but we aligned that that you can do it custom. However, I am failing to see where you ever read the generated config file at all 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will stay to support the next iteration :)

@heliocodacy heliocodacy force-pushed the feature/add-dartanalyzer branch from aed30f9 to 3c0e751 Compare April 15, 2025 08:51
Copy link
Member

@machadoit machadoit left a comment

Choose a reason for hiding this comment

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

👏

@heliocodacy heliocodacy merged commit aa75670 into main Apr 15, 2025
8 checks passed
@heliocodacy heliocodacy deleted the feature/add-dartanalyzer branch April 15, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants