jscpd-gitlab-reporter
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

jscpd-gitlab-reporter

A GitLab Code Quality reporter for jscpd.

This uses the custom tool approach which is a subset of the Code Climate spec.

Getting started

Install

npm install jscpd-gitlab-reporter

Usage

jscpd [...options] --reporters gitlab /path/to/source

See the jspcd CLI docs for available options and configuration.

CI/CD Definition

Add the following to your .gitlab-ci.yml

check:duplicates:
  image: node:20.14.0-alpine3.20
  stage: codequality
  script:
    - npm ci
    - npx jscpd --reporters gitlab src/**/*
  artifacts:
    reports:
      codequality: report/gl-codequality.json

Additional Configuration

CI_PROJECT_DIR

Predefined GitLab CI variable is used to determine the relative file paths in the report. Defaults to the current working directory.

CODE_QUALITY_REPORT

Specifies a custom report file path. Defaults to gl-codequality.json in the jscpd output directory, which itself defaults to report/.

CODE_QUALITY_APPEND

Merge the produced findings with an existing quality report if it already exists. Useful when utilising multiple tools in the same GitLab job. Defaults to false.


MIT | Based on the @jscpd/serif-reporter by Andrey Kucherenko

Package Sidebar

Install

npm i jscpd-gitlab-reporter

Weekly Downloads

7

Version

1.0.0

License

MIT

Unpacked Size

20.8 kB

Total Files

9

Last publish

Collaborators

  • mheynz