codeclimate-fede 0.85.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/bin/check +18 -0
  3. data/bin/codeclimate +21 -0
  4. data/bin/prep-release +45 -0
  5. data/bin/publish +47 -0
  6. data/bin/release +41 -0
  7. data/bin/validate-release +18 -0
  8. data/config/engines.yml +322 -0
  9. data/lib/cc/analyzer/bridge.rb +106 -0
  10. data/lib/cc/analyzer/composite_container_listener.rb +21 -0
  11. data/lib/cc/analyzer/container/result.rb +74 -0
  12. data/lib/cc/analyzer/container.rb +208 -0
  13. data/lib/cc/analyzer/container_listener.rb +9 -0
  14. data/lib/cc/analyzer/engine.rb +125 -0
  15. data/lib/cc/analyzer/engine_output.rb +74 -0
  16. data/lib/cc/analyzer/engine_output_filter.rb +36 -0
  17. data/lib/cc/analyzer/engine_output_overrider.rb +31 -0
  18. data/lib/cc/analyzer/filesystem.rb +50 -0
  19. data/lib/cc/analyzer/formatters/formatter.rb +53 -0
  20. data/lib/cc/analyzer/formatters/html_formatter.rb +415 -0
  21. data/lib/cc/analyzer/formatters/json_formatter.rb +38 -0
  22. data/lib/cc/analyzer/formatters/plain_text_formatter.rb +101 -0
  23. data/lib/cc/analyzer/formatters/spinner.rb +35 -0
  24. data/lib/cc/analyzer/formatters.rb +21 -0
  25. data/lib/cc/analyzer/issue.rb +69 -0
  26. data/lib/cc/analyzer/issue_sorter.rb +30 -0
  27. data/lib/cc/analyzer/issue_validations/category_validation.rb +32 -0
  28. data/lib/cc/analyzer/issue_validations/check_name_presence_validation.rb +15 -0
  29. data/lib/cc/analyzer/issue_validations/content_validation.rb +21 -0
  30. data/lib/cc/analyzer/issue_validations/description_presence_validation.rb +15 -0
  31. data/lib/cc/analyzer/issue_validations/location_format_validation.rb +72 -0
  32. data/lib/cc/analyzer/issue_validations/other_locations_format_validation.rb +41 -0
  33. data/lib/cc/analyzer/issue_validations/path_existence_validation.rb +15 -0
  34. data/lib/cc/analyzer/issue_validations/path_is_file_validation.rb +15 -0
  35. data/lib/cc/analyzer/issue_validations/path_presence_validation.rb +15 -0
  36. data/lib/cc/analyzer/issue_validations/relative_path_validation.rb +32 -0
  37. data/lib/cc/analyzer/issue_validations/remediation_points_validation.rb +25 -0
  38. data/lib/cc/analyzer/issue_validations/severity_validation.rb +39 -0
  39. data/lib/cc/analyzer/issue_validations/type_validation.rb +15 -0
  40. data/lib/cc/analyzer/issue_validations/validation.rb +35 -0
  41. data/lib/cc/analyzer/issue_validations.rb +26 -0
  42. data/lib/cc/analyzer/issue_validator.rb +11 -0
  43. data/lib/cc/analyzer/location_description.rb +45 -0
  44. data/lib/cc/analyzer/logging_container_listener.rb +24 -0
  45. data/lib/cc/analyzer/measurement.rb +22 -0
  46. data/lib/cc/analyzer/measurement_validations/name_validation.rb +23 -0
  47. data/lib/cc/analyzer/measurement_validations/type_validation.rb +15 -0
  48. data/lib/cc/analyzer/measurement_validations/validation.rb +27 -0
  49. data/lib/cc/analyzer/measurement_validations/value_validation.rb +21 -0
  50. data/lib/cc/analyzer/measurement_validations.rb +16 -0
  51. data/lib/cc/analyzer/measurement_validator.rb +11 -0
  52. data/lib/cc/analyzer/mounted_path.rb +80 -0
  53. data/lib/cc/analyzer/raising_container_listener.rb +32 -0
  54. data/lib/cc/analyzer/source_buffer.rb +47 -0
  55. data/lib/cc/analyzer/source_extractor.rb +79 -0
  56. data/lib/cc/analyzer/source_fingerprint.rb +40 -0
  57. data/lib/cc/analyzer/statsd_container_listener.rb +51 -0
  58. data/lib/cc/analyzer/validator.rb +38 -0
  59. data/lib/cc/analyzer.rb +50 -0
  60. data/lib/cc/cli/analyze/engine_failure.rb +11 -0
  61. data/lib/cc/cli/analyze.rb +90 -0
  62. data/lib/cc/cli/command.rb +85 -0
  63. data/lib/cc/cli/console.rb +12 -0
  64. data/lib/cc/cli/engines/engine_command.rb +15 -0
  65. data/lib/cc/cli/engines/install.rb +35 -0
  66. data/lib/cc/cli/engines/list.rb +18 -0
  67. data/lib/cc/cli/engines.rb +5 -0
  68. data/lib/cc/cli/file_store.rb +42 -0
  69. data/lib/cc/cli/global_cache.rb +47 -0
  70. data/lib/cc/cli/global_config.rb +35 -0
  71. data/lib/cc/cli/help.rb +51 -0
  72. data/lib/cc/cli/output.rb +34 -0
  73. data/lib/cc/cli/prepare.rb +98 -0
  74. data/lib/cc/cli/runner.rb +75 -0
  75. data/lib/cc/cli/validate_config.rb +84 -0
  76. data/lib/cc/cli/version.rb +16 -0
  77. data/lib/cc/cli/version_checker.rb +107 -0
  78. data/lib/cc/cli.rb +39 -0
  79. data/lib/cc/config/checks_adapter.rb +40 -0
  80. data/lib/cc/config/default_adapter.rb +54 -0
  81. data/lib/cc/config/engine.rb +41 -0
  82. data/lib/cc/config/engine_set.rb +47 -0
  83. data/lib/cc/config/json_adapter.rb +17 -0
  84. data/lib/cc/config/prepare.rb +92 -0
  85. data/lib/cc/config/validation/check_validator.rb +34 -0
  86. data/lib/cc/config/validation/engine_validator.rb +93 -0
  87. data/lib/cc/config/validation/fetch_validator.rb +78 -0
  88. data/lib/cc/config/validation/file_validator.rb +112 -0
  89. data/lib/cc/config/validation/hash_validations.rb +52 -0
  90. data/lib/cc/config/validation/json.rb +31 -0
  91. data/lib/cc/config/validation/prepare_validator.rb +40 -0
  92. data/lib/cc/config/validation/yaml.rb +66 -0
  93. data/lib/cc/config/yaml_adapter.rb +73 -0
  94. data/lib/cc/config.rb +70 -0
  95. data/lib/cc/engine_registry.rb +74 -0
  96. data/lib/cc/resolv.rb +39 -0
  97. data/lib/cc/workspace/exclusion.rb +34 -0
  98. data/lib/cc/workspace/path_tree/dir_node.rb +67 -0
  99. data/lib/cc/workspace/path_tree/file_node.rb +31 -0
  100. data/lib/cc/workspace/path_tree.rb +49 -0
  101. data/lib/cc/workspace.rb +39 -0
  102. metadata +279 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 658b6d3c606c2840b4ab642676e0c61554ca4b1c
4
+ data.tar.gz: 0e899e65dbd81e04f2e2af0f31b931c4e04bdb28
5
+ SHA512:
6
+ metadata.gz: 4eb9a2e3f6b8c635c2a08ed75156cff4c1c156dda855d340da24568ecb7757a9a9000ce2ce3eb32ec641e52d2c8993768bae1b0601f586ada89ac553b1236e46
7
+ data.tar.gz: 9c9e32e6385cd186a320efdca9cae410a5261e092cd239534af640b0649bb2401509dd969e53e98ef795e9700b655f2fa0645ff225bffa4e5b537cfb3af73a04
data/bin/check ADDED
@@ -0,0 +1,18 @@
1
+ #!/bin/sh
2
+
3
+ command -v docker > /dev/null 2>&1 || {
4
+ echo "Unable to find \`docker' on your \$PATH, is it installed?" >&2
5
+ exit 1
6
+ }
7
+
8
+ docker version | grep -q "Server version\|Server:" || {
9
+ echo "Unable to run \`docker version', the docker daemon may not be running" >&2
10
+
11
+ if [ "$(id --user)" -eq 0 ]; then
12
+ echo "Please ensure \`sudo docker version' succeeds and try again" >&2
13
+ else
14
+ echo "Please ensure \`docker version' succeeds and try again" >&2
15
+ fi
16
+
17
+ exit 1
18
+ }
data/bin/codeclimate ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "../lib")))
3
+
4
+ require "cc/cli"
5
+
6
+ if ENV["CODECLIMATE_PROFILE"]
7
+ require "stackprof"
8
+
9
+ StackProf.start mode: :wall, out: "profile.bin"
10
+ end
11
+
12
+ CC::CLI::Runner.run(ARGV)
13
+
14
+ if ENV["CODECLIMATE_PROFILE"]
15
+ StackProf.stop
16
+ StackProf.results
17
+
18
+ system "stackprof profile.bin"
19
+ puts
20
+ system "stackprof --graphviz profile.bin"
21
+ end
data/bin/prep-release ADDED
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+ #
3
+ # Open a PR for releasing a new version of this repository.
4
+ #
5
+ # Usage: bin/prep-release VERSION
6
+ #
7
+ ###
8
+ set -e
9
+
10
+ if [ -z "$1" ]; then
11
+ echo "usage: bin/prep-release VERSION" >&2
12
+ exit 64
13
+ fi
14
+
15
+ ./bin/validate-release
16
+
17
+ version="$1"
18
+ old_version=$(< VERSION)
19
+ branch="release-$version"
20
+
21
+
22
+ printf "RELEASE %s => %s\n" "$old_version" "$version"
23
+ git fetch origin master
24
+ git reset --hard origin/master
25
+
26
+ git checkout -b "$branch"
27
+
28
+ printf "%s\n" "$version" > VERSION
29
+ make image bundle
30
+ git add VERSION Gemfile.lock
31
+ git commit --message "Release v$version"
32
+ git push origin "$branch"
33
+
34
+ branch_head=$(git rev-parse --short "$branch")
35
+ if command -v hub > /dev/null 2>&1; then
36
+ hub pull-request -F - <<EOF
37
+ Release v$version
38
+
39
+ https://github.com/codeclimate/codeclimate/compare/v$old_version...$branch_head
40
+ EOF
41
+ else
42
+ echo "hub not installed? Please open the PR manually" >&2
43
+ fi
44
+
45
+ echo "After merging the version-bump PR, run bin/release"
data/bin/publish ADDED
@@ -0,0 +1,47 @@
1
+ #!/bin/sh
2
+ #
3
+ # Publish new gem version and creates GH tag for it.
4
+ #
5
+ ###
6
+
7
+ set -e
8
+ set -o nounset
9
+ set -o errexit
10
+ #set -o pipefail
11
+
12
+ mkdir -p $HOME/.gem
13
+ touch $HOME/.gem/credentials
14
+ chmod 0600 $HOME/.gem/credentials
15
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
16
+ gem build *.gemspec
17
+ gem push *.gem
18
+ rake release
19
+
20
+
21
+ #version=$(< VERSION)
22
+
23
+ #docker build --rm --tag codeclimate/codeclimate .
24
+ #docker push codeclimate/codeclimate:latest
25
+ #docker tag codeclimate/codeclimate "codeclimate/codeclimate:$version"
26
+ #docker push "codeclimate/codeclimate:$version"
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ #PROJECT_RELATIVE_PATH=src/github.com/codeclimate/test-reporter
36
+ #
37
+ ## Install go
38
+ #curl -O https://dl.google.com/go/go1.15.darwin-amd64.tar.gz
39
+ #tar -xzf go1.15.darwin-amd64.tar.gz
40
+ #echo 'export PATH=$PATH:$PWD/go/bin' >> "$BASH_ENV"
41
+ #
42
+ ## Set go path
43
+ #mkdir -p ~/gopath/${PROJECT_RELATIVE_PATH}
44
+ #echo 'export GOPATH=$HOME/gopath' >> "$BASH_ENV"
45
+ #. "$BASH_ENV"
46
+ #cd $GOPATH/${PROJECT_RELATIVE_PATH}
47
+ #cp -r ~/project/ $GOPATH/${PROJECT_RELATIVE_PATH}
data/bin/release ADDED
@@ -0,0 +1,41 @@
1
+ #!/bin/bash
2
+ #
3
+ # Release a new version of this repository.
4
+ #
5
+ # Assumes bin/prep-release was run and the PR merged.
6
+ #
7
+ # Usage: bin/release
8
+ #
9
+ ###
10
+ set -e
11
+
12
+ ./bin/validate-release
13
+
14
+ version=$(< VERSION)
15
+
16
+ git fetch origin master
17
+ git reset --hard origin/master
18
+
19
+ printf "RELEASE %s\n" "$version"
20
+ bundle check || bundle install
21
+
22
+ printf "############################################################################"
23
+ printf "# The stdout will eventually hang with no message. #"
24
+ printf "# It is waiting for RubyGems TFA code input, type it in and hit enter! #"
25
+ printf "############################################################################"
26
+ printf "\n\n"
27
+ rake release
28
+
29
+ docker build --rm --tag codeclimate/codeclimate .
30
+ docker push codeclimate/codeclimate:latest
31
+ docker tag codeclimate/codeclimate "codeclimate/codeclimate:$version"
32
+ docker push "codeclimate/codeclimate:$version"
33
+
34
+ (cd ../homebrew-formulae/ && bin/release "$version")
35
+
36
+ cat <<EOM
37
+ Be sure to update release notes:
38
+
39
+ https://github.com/codeclimate/codeclimate/releases/new?tag=v$version
40
+
41
+ EOM
@@ -0,0 +1,18 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ if ! [ "$(git symbolic-ref --short HEAD)" = "master" ]; then
6
+ printf "must be on master branch to run\n" >&2
7
+ exit 1
8
+ fi
9
+
10
+ if ! git diff-index --quiet HEAD --; then
11
+ printf "commit or stash your workspace changes\n" >&2
12
+ exit 1
13
+ fi
14
+
15
+ if ! make test; then
16
+ printf "test suite failed. not releasing\n" >&2
17
+ exit 1
18
+ fi
@@ -0,0 +1,322 @@
1
+ # This file lists all the engines available to be run for analysis.
2
+ #
3
+ # Each engine must have `channels` (with a `stable` key) and `description`. The
4
+ # values in `channels` will be passed to `docker run` and so may be any value
5
+ # appropriate for that (repo/name:tag, image id, etc).
6
+ apexmetrics:
7
+ channels:
8
+ stable: codeclimate/codeclimate-apexmetrics
9
+ description: ApexMetrics is a static code analysis tool for Salesforce.com Apex.
10
+ bandit:
11
+ channels:
12
+ stable: codeclimate/codeclimate-bandit
13
+ description: A tool designed to find common security issues in Python code.
14
+ brakeman:
15
+ channels:
16
+ stable: codeclimate/codeclimate-brakeman
17
+ description: A static analysis tool which checks Ruby on Rails applications for security vulnerabilities.
18
+ bundler-audit:
19
+ channels:
20
+ stable: codeclimate/codeclimate-bundler-audit
21
+ description: Patch-level verification for Bundler.
22
+ checkstyle:
23
+ channels:
24
+ stable: codeclimate/codeclimate-checkstyle
25
+ description: Helps programmers write Java that adheres to a coding standard.
26
+ csslint:
27
+ channels:
28
+ stable: codeclimate/codeclimate-csslint
29
+ description: Automated linting of Cascading Stylesheets.
30
+ coffeelint:
31
+ channels:
32
+ stable: codeclimate/codeclimate-coffeelint
33
+ description: A style checker for CoffeeScript.
34
+ codenarc:
35
+ channels:
36
+ stable: codeclimate/codeclimate-codenarc
37
+ description: >
38
+ CodeNarc analyzes Groovy code for defects, bad practices, inconsistencies,
39
+ style issues, and more.
40
+ cppcheck:
41
+ channels:
42
+ stable: codeclimate/codeclimate-cppcheck
43
+ description: >
44
+ Cppcheck is a static analysis tool for C/C++ code.
45
+ credo:
46
+ channels:
47
+ stable: codeclimate/codeclimate-credo
48
+ description: >
49
+ A static code analysis tool for the Elixir language with a focus on code
50
+ consistency and teaching.
51
+ dart:
52
+ channels:
53
+ stable: codeclimate/codeclimate-dart
54
+ description: >
55
+ A static analysis tool that helps improve code quality for the Dart language.
56
+ duplication:
57
+ channels:
58
+ stable: codeclimate/codeclimate-duplication
59
+ description: Structural duplication detection for Ruby, Python, Java, JavaScript, and PHP.
60
+ editorconfig:
61
+ channels:
62
+ stable: codeclimate/codeclimate-editorconfig
63
+ description: >
64
+ EditorConfig helps developers define and maintain consistent coding styles
65
+ between different editors and IDEs.
66
+ ember-template-lint:
67
+ channels:
68
+ stable: codeclimate/codeclimate-ember-template-lint
69
+ description: Linter for Ember or Handlebars templates.
70
+ eslint:
71
+ channels:
72
+ stable: codeclimate/codeclimate-eslint
73
+ eslint-1: codeclimate/codeclimate-eslint:eslint-1
74
+ eslint-2: codeclimate/codeclimate-eslint:eslint-2
75
+ eslint-3: codeclimate/codeclimate-eslint:eslint-3
76
+ eslint-4: codeclimate/codeclimate-eslint:eslint-4
77
+ eslint-5: codeclimate/codeclimate-eslint:eslint-5
78
+ eslint-6: codeclimate/codeclimate-eslint:eslint-6
79
+ eslint-7: codeclimate/codeclimate-eslint:eslint-7
80
+ description: A JavaScript/JSX linting utility.
81
+ flog:
82
+ channels:
83
+ stable: codeclimate/codeclimate-flog
84
+ description: Easy to read reporting of complexity/pain for Ruby code.
85
+ git-legal:
86
+ channels:
87
+ stable: codeclimate/codeclimate-git-legal
88
+ description: License compliance and compatibility analysis.
89
+ gofmt:
90
+ channels:
91
+ stable: codeclimate/codeclimate-gofmt
92
+ description: Checks the formatting of Go programs.
93
+ golint:
94
+ channels:
95
+ stable: codeclimate/codeclimate-golint
96
+ description: A linter for Go.
97
+ govet:
98
+ channels:
99
+ stable: codeclimate/codeclimate-govet
100
+ description: Reports suspicious constructs in Go programs.
101
+ grep:
102
+ channels:
103
+ stable: codeclimate/codeclimate-grep
104
+ description: Detects specified patterns in files.
105
+ fixme:
106
+ channels:
107
+ stable: codeclimate/codeclimate-fixme
108
+ description: Finds FIXME, TODO, HACK, etc. comments.
109
+ foodcritic:
110
+ channels:
111
+ stable: codeclimate/codeclimate-foodcritic
112
+ description: Lint tool for Chef cookbooks.
113
+ git-legal:
114
+ channels:
115
+ stable: codeclimate/codeclimate-git-legal
116
+ description: License compliance and compatibility analysis.
117
+ gnu-complexity:
118
+ channels:
119
+ stable: codeclimate/codeclimate-gnu-complexity
120
+ description: Checks complexity of C code.
121
+ haxe-checkstyle:
122
+ channels:
123
+ stable: codeclimate/codeclimate-haxe-checkstyle
124
+ description: Checkstyle is a development library to help developers write Haxe code that adheres to a coding standard.
125
+ haml-lint:
126
+ channels:
127
+ stable: codeclimate/codeclimate-haml-lint
128
+ description: A tool for writing clean and consistent HAML.
129
+ hlint:
130
+ channels:
131
+ stable: codeclimate/codeclimate-hlint
132
+ description: A linter for Haskell programs.
133
+ kibit:
134
+ channels:
135
+ stable: codeclimate/codeclimate-kibit
136
+ description: Static code analyzer for Clojure, ClojureScript, cljx and other Clojure variants.
137
+ luacheck:
138
+ channels:
139
+ stable: codeclimate/codeclimate-luacheck
140
+ description: >
141
+ A tool for linting and static analysis of Lua code.
142
+ markdownlint:
143
+ channels:
144
+ stable: codeclimate/codeclimate-markdownlint
145
+ description: Flags style issues within Markdown files.
146
+ nodesecurity:
147
+ channels:
148
+ stable: codeclimate/codeclimate-nodesecurity
149
+ description: Security tool for Node.js dependencies.
150
+ pep8:
151
+ channels:
152
+ stable: codeclimate/codeclimate-pep8
153
+ description: Static analysis tool to check Python code against the style conventions outlined in PEP-8.
154
+ phan:
155
+ channels:
156
+ stable: codeclimate/codeclimate-phan
157
+ beta: codeclimate/codeclimate-phan:beta
158
+ description: Phan is a static analyzer for PHP.
159
+ phpcodesniffer:
160
+ channels:
161
+ stable: codeclimate/codeclimate-phpcodesniffer
162
+ beta: codeclimate/codeclimate-phpcodesniffer:beta
163
+ description: Detects violations of a defined set of coding standards in PHP.
164
+ phpmd:
165
+ channels:
166
+ stable: codeclimate/codeclimate-phpmd
167
+ description: A PHP static analysis tool.
168
+ pmd:
169
+ channels:
170
+ stable: codeclimate/codeclimate-pmd
171
+ beta: codeclimate/codeclimate-pmd:beta
172
+ description: A source code analyzer for Java.
173
+ pylint:
174
+ channels:
175
+ beta: codeclimate/codeclimate-pylint:beta
176
+ stable: codeclimate/codeclimate-pylint
177
+ description: A linter for Python.
178
+ radon:
179
+ channels:
180
+ stable: codeclimate/codeclimate-radon
181
+ description: Python tool used to compute Cyclomatic Complexity.
182
+ reek:
183
+ channels:
184
+ stable: codeclimate/codeclimate-reek
185
+ beta: codeclimate/codeclimate-reek:beta
186
+ description: >
187
+ Reek examines Ruby classes, modules, and methods and reports any code
188
+ smells it finds.
189
+ requiresafe:
190
+ channels:
191
+ stable: codeclimate/codeclimate-nodesecurity
192
+ description: Security tool for Node.js dependencies.
193
+ rubocop:
194
+ channels:
195
+ stable: codeclimate/codeclimate-rubocop
196
+ cache-support: codeclimate/codeclimate-rubocop:cache-support
197
+ rubocop-0-42: codeclimate/codeclimate-rubocop:rubocop-0-42
198
+ rubocop-0-46: codeclimate/codeclimate-rubocop:rubocop-0-46
199
+ rubocop-0-48: codeclimate/codeclimate-rubocop:rubocop-0-48
200
+ rubocop-0-49: codeclimate/codeclimate-rubocop:rubocop-0-49
201
+ rubocop-0-50: codeclimate/codeclimate-rubocop:rubocop-0-50
202
+ rubocop-0-51: codeclimate/codeclimate-rubocop:rubocop-0-51
203
+ rubocop-0-52: codeclimate/codeclimate-rubocop:rubocop-0-52
204
+ rubocop-0-54: codeclimate/codeclimate-rubocop:rubocop-0-54
205
+ rubocop-0-55: codeclimate/codeclimate-rubocop:rubocop-0-55
206
+ rubocop-0-56: codeclimate/codeclimate-rubocop:rubocop-0-56
207
+ rubocop-0-57: codeclimate/codeclimate-rubocop:rubocop-0-57
208
+ rubocop-0-58: codeclimate/codeclimate-rubocop:rubocop-0-58
209
+ rubocop-0-59: codeclimate/codeclimate-rubocop:rubocop-0-59
210
+ rubocop-0-60: codeclimate/codeclimate-rubocop:rubocop-0-60
211
+ rubocop-0-61: codeclimate/codeclimate-rubocop:rubocop-0-61
212
+ rubocop-0-62: codeclimate/codeclimate-rubocop:rubocop-0-62
213
+ rubocop-0-63: codeclimate/codeclimate-rubocop:rubocop-0-63
214
+ rubocop-0-64: codeclimate/codeclimate-rubocop:rubocop-0-64
215
+ rubocop-0-65: codeclimate/codeclimate-rubocop:rubocop-0-65
216
+ rubocop-0-66: codeclimate/codeclimate-rubocop:rubocop-0-66
217
+ rubocop-0-67: codeclimate/codeclimate-rubocop:rubocop-0-67
218
+ rubocop-0-68: codeclimate/codeclimate-rubocop:rubocop-0-68
219
+ rubocop-0-69: codeclimate/codeclimate-rubocop:rubocop-0-69
220
+ rubocop-0-70: codeclimate/codeclimate-rubocop:rubocop-0-70
221
+ rubocop-0-71: codeclimate/codeclimate-rubocop:rubocop-0-71
222
+ rubocop-0-72: codeclimate/codeclimate-rubocop:rubocop-0-72
223
+ rubocop-0-73: codeclimate/codeclimate-rubocop:rubocop-0-73
224
+ rubocop-0-74: codeclimate/codeclimate-rubocop:rubocop-0-74
225
+ rubocop-0-75: codeclimate/codeclimate-rubocop:rubocop-0-75
226
+ rubocop-0-76: codeclimate/codeclimate-rubocop:rubocop-0-76
227
+ rubocop-0-76-airbnb: codeclimate/codeclimate-rubocop:rubocop-0-76-airbnb
228
+ rubocop-0-77: codeclimate/codeclimate-rubocop:rubocop-0-77
229
+ rubocop-0-78: codeclimate/codeclimate-rubocop:rubocop-0-78
230
+ rubocop-0-79: codeclimate/codeclimate-rubocop:rubocop-0-79
231
+ rubocop-0-80: codeclimate/codeclimate-rubocop:rubocop-0-80
232
+ rubocop-0-81: codeclimate/codeclimate-rubocop:rubocop-0-81
233
+ rubocop-0-82: codeclimate/codeclimate-rubocop:rubocop-0-82
234
+ rubocop-0-83: codeclimate/codeclimate-rubocop:rubocop-0-83
235
+ rubocop-0-84: codeclimate/codeclimate-rubocop:rubocop-0-84
236
+ rubocop-0-85: codeclimate/codeclimate-rubocop:rubocop-0-85
237
+ rubocop-0-86: codeclimate/codeclimate-rubocop:rubocop-0-86
238
+ rubocop-0-87: codeclimate/codeclimate-rubocop:rubocop-0-87
239
+ rubocop-0-88: codeclimate/codeclimate-rubocop:rubocop-0-88
240
+ rubocop-0-89: codeclimate/codeclimate-rubocop:rubocop-0-89
241
+ rubocop-0-90: codeclimate/codeclimate-rubocop:rubocop-0-90
242
+ rubocop-0-92: codeclimate/codeclimate-rubocop:rubocop-0-92
243
+ rubocop-1-7-0: codeclimate/codeclimate-rubocop:rubocop-1-7-0
244
+ rubocop-1-8-1: codeclimate/codeclimate-rubocop:rubocop-1-8-1
245
+ description: A Ruby static code analyzer, based on the community Ruby style guide.
246
+ rubymotion:
247
+ channels:
248
+ stable: codeclimate/codeclimate-rubymotion
249
+ description: Rubymotion-specific rubocop checks.
250
+ sass-lint:
251
+ channels:
252
+ stable: codeclimate/codeclimate-sass-lint
253
+ description: >
254
+ A Node-only Sass linter for both sass and scss syntax!
255
+ scalastyle:
256
+ channels:
257
+ stable: codeclimate/codeclimate-scalastyle
258
+ description: >
259
+ A tool which examines your Scala code and indicates potential problems.
260
+ scss-lint:
261
+ channels:
262
+ stable: codeclimate/codeclimate-scss-lint
263
+ description: A configurable tool for writing clean and consistent SCSS.
264
+ semgrep:
265
+ channels:
266
+ stable: codeclimate/codeclimate-semgrep
267
+ description: A configurable tool that allows for custom static analysis on multiple languages.
268
+ shellcheck:
269
+ channels:
270
+ stable: codeclimate/codeclimate-shellcheck
271
+ description: A static analysis tool for shell scripts.
272
+ sonar-java:
273
+ channels:
274
+ stable: codeclimate/codeclimate-sonar-java
275
+ beta: codeclimate/codeclimate-sonar-java:sonar-java-5-14
276
+ sonar-java-5-14: codeclimate/codeclimate-sonar-java:sonar-java-5-14
277
+ description: Over 400 checks for bugs, vulnerabilities, and code smells in Java code.
278
+ minimum_memory_limit: 2_048_000_000
279
+ sonar-php:
280
+ channels:
281
+ stable: codeclimate/codeclimate-sonar-php
282
+ description: SonarLint for PHP.
283
+ minimum_memory_limit: 2_048_000_000
284
+ sonar-python:
285
+ channels:
286
+ stable: codeclimate/codeclimate-sonar-python
287
+ description: SonarLint for Python.
288
+ minimum_memory_limit: 2_048_000_000
289
+ standard:
290
+ channels:
291
+ stable: codeclimate/codeclimate-standard
292
+ beta: codeclimate/codeclimate-standard
293
+ description: Standard static analysis tool.
294
+ structure:
295
+ channels:
296
+ stable: codeclimate/codeclimate-structure
297
+ description: Performs structural checks on code.
298
+ stylelint:
299
+ channels:
300
+ beta: codeclimate/codeclimate-stylelint:beta
301
+ stable: codeclimate/codeclimate-stylelint
302
+ description: A mighty, modern CSS linter.
303
+ swiftlint:
304
+ channels:
305
+ stable: codeclimate/codeclimate-swiftlint
306
+ description: A tool to enforce Swift style and conventions.
307
+ tailor:
308
+ channels:
309
+ stable: codeclimate/codeclimate-tailor
310
+ description: Cross-platform static analyzer and linter for Swift.
311
+ tslint:
312
+ channels:
313
+ stable: codeclimate/codeclimate-tslint
314
+ description: An extensible linter for the TypeScript language
315
+ watson:
316
+ channels:
317
+ stable: codeclimate/codeclimate-watson
318
+ description: A young Ember Doctor to help you fix your code.
319
+ vint:
320
+ channels:
321
+ stable: codeclimate/codeclimate-vint
322
+ description: Fast and Highly Extensible Vim script Language Lint implemented by Python.
@@ -0,0 +1,106 @@
1
+ module CC
2
+ module Analyzer
3
+ # The shared interface, invoked by Builder or CLI::Analyze
4
+ #
5
+ # Input:
6
+ # - config
7
+ # - engines
8
+ # - exclude_patterns
9
+ # - development?
10
+ # - analysis_paths
11
+ # - formatter
12
+ # - started
13
+ # - engine_running
14
+ # - finished
15
+ # - close
16
+ # - listener
17
+ # - started(engine, details)
18
+ # - finished(engine, details, result)
19
+ # - registry
20
+ #
21
+ # Only raises if Listener raises
22
+ #
23
+ class Bridge
24
+ def initialize(config:, formatter:, listener:, registry:)
25
+ @config = config
26
+ @formatter = formatter
27
+ @listener = listener
28
+ @registry = registry
29
+ end
30
+
31
+ def run
32
+ formatter.started
33
+
34
+ config.engines.each do |engine|
35
+ next unless engine.enabled?
36
+
37
+ formatter.engine_running(engine) do
38
+ result = nil
39
+ engine_details = nil
40
+
41
+ begin
42
+ engine_details = registry.fetch_engine_details(
43
+ engine,
44
+ development: config.development?,
45
+ )
46
+ listener.started(engine, engine_details)
47
+ result = run_engine(engine, engine_details)
48
+ rescue CC::EngineRegistry::EngineDetailsNotFoundError => ex
49
+ result = Container::Result.skipped(ex)
50
+ end
51
+
52
+ listener.finished(engine, engine_details, result)
53
+ result
54
+ end
55
+ end
56
+
57
+ formatter.finished
58
+ ensure
59
+ formatter.close
60
+ end
61
+
62
+ private
63
+
64
+ attr_reader :config, :formatter, :listener, :registry
65
+
66
+ def run_engine(engine, engine_details)
67
+ # Analyzer::Engine doesn't have the best interface, but we're limiting
68
+ # our refactors for now.
69
+ Engine.new(
70
+ engine.name,
71
+ {
72
+ "image" => engine_details.image,
73
+ "command" => engine_details.command,
74
+ "memory" => engine_details.memory,
75
+ },
76
+ engine.config.merge(
77
+ "channel" => engine.channel,
78
+ "include_paths" => engine_workspace(engine).paths,
79
+ ),
80
+ engine.container_label,
81
+ ).run(formatter)
82
+ end
83
+
84
+ def engine_workspace(engine)
85
+ if engine.exclude_patterns.any?
86
+ workspace.clone.tap do |engine_workspace|
87
+ engine_workspace.remove(engine.exclude_patterns)
88
+ end
89
+ else
90
+ workspace
91
+ end
92
+ end
93
+
94
+ def workspace
95
+ @workspace ||= Workspace.new.tap do |workspace|
96
+ workspace.add(config.analysis_paths)
97
+
98
+ unless config.analysis_paths.any?
99
+ workspace.remove([".git"])
100
+ workspace.remove(config.exclude_patterns)
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,21 @@
1
+ module CC
2
+ module Analyzer
3
+ class CompositeContainerListener < ContainerListener
4
+ def initialize(*listeners)
5
+ @listeners = listeners
6
+ end
7
+
8
+ def started(*args)
9
+ listeners.each { |listener| listener.started(*args) }
10
+ end
11
+
12
+ def finished(*args)
13
+ listeners.each { |listener| listener.finished(*args) }
14
+ end
15
+
16
+ private
17
+
18
+ attr_reader :listeners
19
+ end
20
+ end
21
+ end