1. moneyforward/dscar-coffeelint@1.2.0

moneyforward/dscar-coffeelint@1.2.0

Sections
Delta CoffeeLint reports
Created: March 26, 2020Version Published: April 15, 2020Releases: 5
Org Usage:
< 25

Orb Quick Start Guide

Use CircleCI version 2.1 at the top of your .circleci/config.yml file.

1 version: 2.1

Add the orbs stanza below your version, invoking the orb:

1 2 orbs: dscar-coffeelint: moneyforward/dscar-coffeelint@1.2.0

Use dscar-coffeelint elements in your existing workflows and jobs.

Opt-in to use of uncertified orbs on your organization’s Security settings page.

Jobs

analyze

Analyze code statically using CoffeeLint and then evaluate the result

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
analyze
Specify analysis steps
No
[sequence of length 1] see source
steps
circle_compare_url-path
Specify the path of `CIRCLE_COMPARE_URL.txt` if you are using `iynere/compare-url` orb
No
''
string
executor
Specify the image used to execute analysis
No
default
executor
parallelism
If parallelism is set to N > 1, then N independent executors will be set up and each will run the steps of that job in parallel.
No
1
integer
resource_class
Amount of CPU and RAM allocated to each container in a job.
No
small
string
test-results-path
Specify the value of the path parameter in the store_test_results step if you need to change it
No
/tmp/test-results
string
vcs-api-token
Specify the environment variable name where the VCS (Version Control System) API token is set.
No
GITHUB_TOKEN
env_var_name

execute

Calculate the difference of CoffeeLint results between HEAD branch and BASE branch and then evaluate the result

Show job Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
analyze
Specify analysis steps
No
[sequence of length 1] see source
steps
circle_compare_url-path
Specify the path of `CIRCLE_COMPARE_URL.txt` if you are using `iynere/compare-url` orb
No
''
string
executor
Specify the image used to execute analysis
No
default
executor
parallelism
If parallelism is set to N > 1, then N independent executors will be set up and each will run the steps of that job in parallel.
No
1
integer
resource_class
Amount of CPU and RAM allocated to each container in a job.
No
small
string
test-results-path
Specify the value of the path parameter in the store_test_results step if you need to change it
No
/tmp/test-results
string
vcs-api-token
Specify the environment variable name where the VCS (Version Control System) API token is set.
No
GITHUB_TOKEN
env_var_name

Commands

analyze

Analyze code statically using CoffeeLint

Show command Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
analysis-arguments
Arguments of analysis command
No
''
string
analysis-results-path
Specify the path to save the analysis results if you need to change it (default: /tmp/dscar/analysis-results)
No
''
string
error-pattern
Specify the pattern if you want to detect analyzing errors from the standard error
No
.*
string
max-procs
Specify the maximum number of processes to run at the same time
No
1
integer
no-analysis-output-timeout
Elapsed time the command can run without output. The string is a decimal with unit suffix, such as “20m”, “1.25h”, “5s”
No
10m
string
patterns-to-exclude
Specify patterns to exclude by regular expression (Multiple patterns can be specified by separating them with line feed)
No
| ^\./\.git/.* ^\./node_modules/.*
string
patterns-to-include
Specify patterns to include by regular expression (Multiple patterns can be specified by separating them with line feed)
No
.*\.coffee$
string
prepare
Specify the required steps before analysis if necessary
No
[sequence of length 1] see source
steps
redirecting-output
Specify "/dev/null" if you do not want to display the analysis results on the standard output
No
/dev/null
enum
starting-points
Specify the path of starting to search for files to analyze (Multiple paths can be specified by separating them with line feed)
No
.
string

install-analyzer

Install CoffeeLint

Show command Source

Executors

default

Default CoffeeLint execution environment

Show executor Source
PARAMETER
DESCRIPTION
REQUIRED
DEFAULT
TYPE
analysis-results-path
Specify the path to save the analysis results if you need to change it
No
/tmp/dscar/analysis-results
string
docker-image
Specify the image used to execute CoffeeLint
No
circleci/node
string
git-base_revision
Please set << pipeline.git-base_revision >>
No
'0000000000000000000000000000000000000000'
string
git-revision
Please set << pipeline.git-revision >>
Yes
-
string
project-git_url
Please set << pipeline.project.git_url >>
Yes
-
string

Orb Source

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 # This code is licensed from CircleCI to the user under the MIT license. # See here for details: https://circleci.com/developer/orbs/licensing commands: analyze: description: Analyze code statically using CoffeeLint parameters: analysis-arguments: default: "" description: Arguments of analysis command type: string analysis-results-path: default: "" description: 'Specify the path to save the analysis results if you need to change it (default: /tmp/dscar/analysis-results)' type: string error-pattern: default: .* description: Specify the pattern if you want to detect analyzing errors from the standard error type: string max-procs: default: 1 description: Specify the maximum number of processes to run at the same time type: integer no-analysis-output-timeout: default: 10m description: Elapsed time the command can run without output. The string is a decimal with unit suffix, such as “20m”, “1.25h”, “5s” type: string patterns-to-exclude: default: | ^\./\.git/.* ^\./node_modules/.* description: Specify patterns to exclude by regular expression (Multiple patterns can be specified by separating them with line feed) type: string patterns-to-include: default: .*\.coffee$ description: Specify patterns to include by regular expression (Multiple patterns can be specified by separating them with line feed) type: string prepare: default: - install-analyzer description: Specify the required steps before analysis if necessary type: steps redirecting-output: default: /dev/null description: Specify "/dev/null" if you do not want to display the analysis results on the standard output enum: - /dev/stdout - /dev/stderr - /dev/null type: enum starting-points: default: . description: Specify the path of starting to search for files to analyze (Multiple paths can be specified by separating them with line feed) type: string steps: - dscar/analyze: analysis-arguments: << parameters.analysis-arguments >> -q --reporter=raw analysis-command: npx analysis-name: CoffeeLint analysis-results-path: << parameters.analysis-results-path >> error-pattern: << parameters.error-pattern >> max-procs: << parameters.max-procs >> no-output-timeout: << parameters.no-analysis-output-timeout >> patterns-to-exclude: << parameters.patterns-to-exclude >> patterns-to-include: << parameters.patterns-to-include >> prepare: - run: sudo apt-get install jq - run: command: | set -x ANALYSIS_COMMAND=coffeelint declare -ax ANALYSIS_ARGUMENTS=("${ANALYSIS_COMMAND}" "${ANALYSIS_ARGUMENTS[@]}") echo "$(declare -p ANALYSIS_ARGUMENTS)" >> $BASH_ENV FILTER="$( cat \<<-"EOT" | tr -s ' \n' ' ' map(to_entries) | flatten | map((@html "<file name=\"\(.key)\">") + "\(.value | map( @html "<error source=\"\(.name)\" message=\"\(.message)\" severity=\"\(.level)\" line=\"\(.lineNumber)\" column=\"0\" />" ) | join(""))</file>") | "<checkstyle>\(join(""))</checkstyle>" EOT )" declare -ax TRANSFORMATION_ARGUMENTS=( -srM "$FILTER" ) echo "$(declare -p TRANSFORMATION_ARGUMENTS)" >> $BASH_ENV name: export TRANSFORMATION_ARGUMENTS - steps: << parameters.prepare >> redirecting-output: << parameters.redirecting-output >> should-find: "true" starting-points: << parameters.starting-points >> step-name: Analyze code statically using CoffeeLint transformation-command: jq install-analyzer: description: Install CoffeeLint steps: - run: sudo npm install --global @coffeelint/cli description: Delta CoffeeLint reports display: home_url: https://corp.moneyforward.com/ source_url: https://github.com/moneyforward/dscar-coffeeLint executors: default: description: Default CoffeeLint execution environment docker: - image: << parameters.docker-image >> environment: CIRCLE_COMPARE_URL: << parameters.project-git_url >>/compare/<< parameters.git-base_revision >>..<< parameters.git-revision >> DSCAR_ANALYSIS_RESULTS_PATH: << parameters.analysis-results-path >> parameters: analysis-results-path: default: /tmp/dscar/analysis-results description: Specify the path to save the analysis results if you need to change it type: string docker-image: default: circleci/node description: Specify the image used to execute CoffeeLint type: string git-base_revision: default: "0000000000000000000000000000000000000000" description: Please set << pipeline.git-base_revision >> type: string git-revision: description: Please set << pipeline.git-revision >> type: string project-git_url: description: Please set << pipeline.project.git_url >> type: string jobs: analyze: description: Analyze code statically using CoffeeLint and then evaluate the result executor: << parameters.executor >> parallelism: << parameters.parallelism >> parameters: analyze: default: - analyze description: Specify analysis steps type: steps circle_compare_url-path: default: "" description: Specify the path of `CIRCLE_COMPARE_URL.txt` if you are using `iynere/compare-url` orb type: string executor: default: default description: Specify the image used to execute analysis type: executor parallelism: default: 1 description: If parallelism is set to N > 1, then N independent executors will be set up and each will run the steps of that job in parallel. type: integer resource_class: default: small description: Amount of CPU and RAM allocated to each container in a job. type: string test-results-path: default: /tmp/test-results description: Specify the value of the path parameter in the store_test_results step if you need to change it type: string vcs-api-token: default: GITHUB_TOKEN description: Specify the environment variable name where the VCS (Version Control System) API token is set. type: env_var_name resource_class: << parameters.resource_class >> steps: - dscar/analyze-and-evaluate: analyze: << parameters.analyze >> circle_compare_url-path: << parameters.circle_compare_url-path >> test-results-path: << parameters.test-results-path >> vcs-api-token: << parameters.vcs-api-token >> execute: description: Calculate the difference of CoffeeLint results between HEAD branch and BASE branch and then evaluate the result executor: << parameters.executor >> parallelism: << parameters.parallelism >> parameters: analyze: default: - analyze description: Specify analysis steps type: steps circle_compare_url-path: default: "" description: Specify the path of `CIRCLE_COMPARE_URL.txt` if you are using `iynere/compare-url` orb type: string executor: default: default description: Specify the image used to execute analysis type: executor parallelism: default: 1 description: If parallelism is set to N > 1, then N independent executors will be set up and each will run the steps of that job in parallel. type: integer resource_class: default: small description: Amount of CPU and RAM allocated to each container in a job. type: string test-results-path: default: /tmp/test-results description: Specify the value of the path parameter in the store_test_results step if you need to change it type: string vcs-api-token: default: GITHUB_TOKEN description: Specify the environment variable name where the VCS (Version Control System) API token is set. type: env_var_name resource_class: << parameters.resource_class >> steps: - dscar/execute-and-evaluate: analyze: << parameters.analyze >> circle_compare_url-path: << parameters.circle_compare_url-path >> test-results-path: << parameters.test-results-path >> vcs-api-token: << parameters.vcs-api-token >> orbs: dscar: moneyforward/dscar@1.2 version: 2.1
Developer Updates
Get tips to optimize your builds
Or join our research panel and give feedback
By submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.