Skip to content

Bitbucket Pipelines pipe for creating a report with annotations from a ReSharper inspections XML. READ ONLY mirror for https://bitbucket.org/loremfoobar/resharper-inspections-bitbucket-pipe/src/main/

License

Notifications You must be signed in to change notification settings

LoremFooBar/resharper-inspections-bitbucket-pipe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitbucket Pipelines Pipe: ReSharper Inspections Report

Create a report with annotations from a ReSharper inspections XML, and a corresponding build status with the status of the report.

YAML Definition

Add the following snippet to the script section of your bitbucket-pipelines.yml file:

script:
  - pipe: docker://loremfoobar/resharper-inspections-bitbucket-pipe:1.1.0
    variables:
      INSPECTIONS_XML_PATH: "<string>"
      # BITBUCKET_USERNAME: "<string>" # Optional
      # BITBUCKET_APP_PASSWORD: "<string>" # Optional
      # CREATE_BUILD_STATUS: "<boolean>" # Optional, default "true"
      # INCLUDE_ONLY_ISSUES_IN_DIFF: "<boolean>" # Optional, default "false"
      # DEBUG: "<boolean>" # Optional

Variables

Variable Usage
INSPECTIONS_XML_PATH (*) Path to inspections xml file, relative to current directory. You can use patterns that
are supported by DirectoryInfo.GetFiles.
BITBUCKET_USERNAME Bitbucket username, required to create build status and to get PR diff.
Note that this should be an account name, not the email.
BITBUCKET_APP_PASSWORD Bitbucket app password, required to create build status and to get PR diff.
CREATE_BUILD_STATUS Whether to create a new build status reflecting the results of the report. Default: true.
FAIL_WHEN_ISSUES_FOUND Whether to fail current build step if any issues found. Default: false.
INCLUDE_ONLY_ISSUES_IN_DIFF Whether to include only issues found in changes of current PR/commit. Default: false.
DEBUG Turn on extra debug information. Default: false.

(*) = required variable.

Prerequisites

Inspections File

You need to create the inspections XML file before calling the pipe. To create the inspections XML file see InspectCode Command-Line Tool .

App Password

App password is required for 2 pipe features:

  1. Create build status when CREATE_BUILD_STATUS="true". Required permission: Repositories - Read.
  2. Get diff (INCLUDE_ONLY_ISSUES_IN_DIFF="true" when in PRs). Required permission: Pull requests - Read.

See Atlassian documentation on how to generate an app password .

Examples

Basic example:

script:
  - pipe: docker://loremfoobar/resharper-inspections-bitbucket-pipe:1.1.0
    variables:
      INSPECTIONS_XML_PATH: "inspect.xml"

With pattern:

script:
  - pipe: docker://loremfoobar/resharper-inspections-bitbucket-pipe:1.1.0
    variables:
      INSPECTIONS_XML_PATH: "src/*/inspect.xml"

With app password (you should use secure variables for username and app password):

script:
  - pipe: docker://loremfoobar/resharper-inspections-bitbucket-pipe:1.1.0
    variables:
      INSPECTIONS_XML_PATH: "inspect.xml"
      BITBUCKET_USERNAME: $USERNAME
      BITBUCKET_APP_PASSWORD: $APP_PASSWORD

With build status creation disabled:

script:
  - pipe: docker://loremfoobar/resharper-inspections-bitbucket-pipe:1.1.0
    variables:
      INSPECTIONS_XML_PATH: "inspect.xml"
      BITBUCKET_USERNAME: $USERNAME
      BITBUCKET_APP_PASSWORD: $APP_PASSWORD
      CREATE_BUILD_STATUS: "false"

Support

If you're reporting an issue, please include:

  • the version of the pipe
  • relevant logs and error messages
  • steps to reproduce

License

MIT License

About

Bitbucket Pipelines pipe for creating a report with annotations from a ReSharper inspections XML. READ ONLY mirror for https://bitbucket.org/loremfoobar/resharper-inspections-bitbucket-pipe/src/main/

Resources

License

Stars

Watchers

Forks

Languages