Skip to content

Conversation

@machadoit
Copy link

To showcase interaction with https://github.com/codacy/codacy-cli-v2

Any repo with the files and installed tools should work:

  • codacy-cli-v2 init
  • codacy-cli-v2 install

The running is to be done inside the plugin

}

for (let i=0; i<repoToolsData.data.length; i++) {
var tool = repoToolsData.data[i]

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Unexpected var, use let or const instead.

Suggested change
var tool = repoToolsData.data[i]
let tool = repoToolsData.data[i]

private _issuesManager = new IssuesManager(this)

private _codingStandardId: number | undefined
private _repoTools: any

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Unexpected any. Specify a different type.

Suggested change
private _repoTools: any
private _repoTools: unknown


const codacyToolsNameMap = new Map<string,string>()
for (let i=0; i<codacyToolsData.data.length; i++) {
let cTool = codacyToolsData.data[i]

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: 'cTool' is never reassigned. Use 'const' instead.

Suggested change
let cTool = codacyToolsData.data[i]
const cTool = codacyToolsData.data[i]

for (let i=0; i<repoToolsData.data.length; i++) {
var tool = repoToolsData.data[i]
if (tool.settings.isEnabled) {
var uuid = codacyToolsNameMap.get(tool.name)

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Unexpected var, use let or const instead.

Suggested change
var uuid = codacyToolsNameMap.get(tool.name)
let uuid = codacyToolsNameMap.get(tool.name)

@alerizzo alerizzo requested review from Copilot and removed request for JoaoCostaCodacy March 19, 2025 12:30
Copy link
Contributor

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.

Pull Request Overview

This PR integrates Codacy CLI v2 with the extension by adding code coverage display and local tooling support. Key changes include:

  • Implementation of coverage decorations in the editor based on PR data.
  • Addition of local tools integration with commands for installing and running tools.
  • Updates to various nodes and repository management to support these new features.

Reviewed Changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/views/coverage.ts Adds coverage decoration functionality for PR files.
src/views/LocalToolsTree.ts Introduces a tree view for managing local tools and refresh logic.
src/local.ts Implements local tooling commands, keypress handling, and tool installation.
src/views/nodes/LocalToolsToolNode.ts Adds nodes for representing individual local tools.
src/views/nodes/LocalToolsNode.ts Provides a base node for local tools with icon updates based on install status.
src/extension.ts Registers new commands for coverage toggling and local mode support.
src/git/RepositoryManager.ts Adds support for loading tool patterns and coding standard details.
src/views/nodes/PullRequestCoverageNode.ts Updates the PR coverage node to toggle coverage display with a tree view ref.
src/common/parseGitRemote.ts Improves the regex for parsing Git remote URLs by allowing an optional .git.
src/git/PullRequest.ts Integrates fetching of coverage data and triggers decoration refresh.
src/views/nodes/BranchIssuesTreeNode.ts Enhances the sorting with safe defaults for severity and category orders.
src/common/glossary.ts Adjusts category ordering and adds new entries in the glossary.
src/views/PullRequestSummaryTree.ts Includes the PR coverage node and refresh method into the summary tree.
src/views/nodes/index.ts Exports the newly added local tools nodes.
Files not reviewed (3)
  • localTools.json: Language not supported
  • openapitools.json: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/views/LocalToolsTree.ts:74

  • The comment indicates that the '_onDidChangeTreeData.fire()' call may not be triggering the expected UI update. Please investigate if additional refresh logic is needed to properly update the tree view.
    // FIXME: this doesn't seem to do anything

this.installStatus = commandExistsSync(this.cliCommand)
}

// I fucking hate this by the way.
Copy link

Copilot AI Mar 19, 2025

Choose a reason for hiding this comment

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

[nitpick] Please remove or rephrase unprofessional language in comments for a more neutral tone.

Suggested change
// I fucking hate this by the way.
// This is frustrating to deal with.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

😂

@alerizzo alerizzo closed this Apr 11, 2025
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.

4 participants