Help Center> CodeArts Check> Best Practices> Performing a Check Task from Git
Updated on 2024-04-22 GMT+08:00

Performing a Check Task from Git

By checking code vulnerabilities and non-standard coding, CodeArts Check improves code quality and instructs developers to form proper coding habits.

This practice describes how to create, execute, and view a check task from Git and how to configure rule sets and tasks.

A common process is as follows:

Preparations

Step 1: Create a task to check code from Git.

After the preparations are complete, you can create a task.

  1. Log in to CodeArts.
  2. Search for a project created in preparations and click the project name.
  3. In the navigation tree, choose Code > Check.
  4. Click Create Task.

    Select the Git code source as well as the endpoint created in preparations and configure the Repository, Branch, and Language.

  5. Click Create Task.

Step 2: (Optional) Create a custom rule set.

After creating a check task, you can create a custom rule set for the task.

  1. Choose Code > Check.
  2. Click Rule set.
  3. Click Create Rule Set. In the displayed dialog box, enter a rule set name and select a language.
  4. Click OK.
  5. Select the required rule names, set issue levels, and click Save in the upper right corner.

Step 3: (Optional) Configure a rule set.

Before executing a task, change the rule set to a custom rule set as required.

  1. Choose Code > Check.
  2. In the Tasks page, click the task name created in step 1.
  3. Choose Settings > Rule Sets.
  4. In the Languages Included area, enable the target language. In the Enable Rule Set area, click the rule set created in step 2.
  5. In the displayed dialog box, click OK to change the language rule set.

Step 4: Execute a check task.

After the rule set is configured, the check task is executed based on the custom rule set.

  1. Choose Code > Check.
  2. In the Tasks page, click Execute immediately in the Last Check column.

    If the check task needs to be executed again, click in the row where the task is located to execute the task again.

  3. Wait until the task is complete as prompted. For details about the check result, see Step 5: View check details..

Step 5: View check details.

After the check task is executed, you can view check details.

  1. Choose Code > Check.
  2. In the Tasks page, search for the task created in step 1.
  3. Click the task name to view the check details, including overview, issues, metrics, logs, and settings.