Skip to content

Commit 6ef9d64

Browse files
committed
Open source commit
0 parents  commit 6ef9d64

16 files changed

+1502
-0
lines changed

.codeclimate.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
engines:
2+
rubocop:
3+
enabled: true
4+
ratings:
5+
paths:
6+
- "**.rb"

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.2.2

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:edge
2+
3+
WORKDIR /usr/src/app
4+
COPY Gemfile /usr/src/app/
5+
COPY Gemfile.lock /usr/src/app/
6+
7+
RUN apk --update add ruby ruby-dev ruby-bundler build-base && \
8+
bundle install -j 4 && \
9+
apk del build-base && rm -fr /usr/share/ri
10+
11+
COPY . /usr/src/app
12+
13+
CMD ["/usr/src/app/bin/codeclimate-rubocop"]

Gemfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
source 'https://rubygems.org'
2+
3+
gem "rubocop", require: false
4+
gem "pry", require: false
5+
6+
group :test do
7+
gem "rake"
8+
gem "minitest"
9+
gem "minitest-reporters"
10+
end

Gemfile.lock

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
ansi (1.5.0)
5+
ast (2.0.0)
6+
astrolabe (1.3.0)
7+
parser (>= 2.2.0.pre.3, < 3.0)
8+
builder (3.2.2)
9+
coderay (1.1.0)
10+
method_source (0.8.2)
11+
minitest (5.6.0)
12+
minitest-reporters (1.0.11)
13+
ansi
14+
builder
15+
minitest (>= 5.0)
16+
ruby-progressbar
17+
parser (2.2.2.5)
18+
ast (>= 1.1, < 3.0)
19+
powerpack (0.1.1)
20+
pry (0.10.1)
21+
coderay (~> 1.1.0)
22+
method_source (~> 0.8.1)
23+
slop (~> 3.4)
24+
rainbow (2.0.0)
25+
rake (10.4.2)
26+
rubocop (0.31.0)
27+
astrolabe (~> 1.3)
28+
parser (>= 2.2.2.1, < 3.0)
29+
powerpack (~> 0.1)
30+
rainbow (>= 1.99.1, < 3.0)
31+
ruby-progressbar (~> 1.4)
32+
ruby-progressbar (1.7.5)
33+
slop (3.6.0)
34+
35+
PLATFORMS
36+
ruby
37+
38+
DEPENDENCIES
39+
minitest
40+
minitest-reporters
41+
pry
42+
rake
43+
rubocop
44+
45+
BUNDLED WITH
46+
1.10.3

LICENSE

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2015 Code Climate, Inc.
2+
3+
Portions copyright (c) 2014 thoughtbot, inc.
4+
Portions copyright (c) 2012-14 Bozhidar Batsov
5+
Portions copyright (c) 2013 Peter Zotov <[email protected]>
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in
15+
all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
THE SOFTWARE.

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Code Climate Rubocop Engine
2+
3+
[![Code Climate](https://codeclimate.com/repos/5584174c6956807f6701c8f5/badges/9b8937da146a0abf21d4/gpa.svg)](https://codeclimate.com/repos/5584174c6956807f6701c8f5/feed)
4+
5+
`codeclimate-rubocop` is a Code Climate engine that wraps the [RuboCop](https://github.com/bbatsov/rubocop) static analysis tool. You can run it on your command line using the Code Climate CLI, or on our hosted analysis platform.
6+
7+
RuboCop helps you enforce many of the guidelines outlined in the community [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide). Most aspects of its behavior can be tweaked via various [configuration options](https://github.com/bbatsov/rubocop/blob/master/config/default.yml), which are set in a **.rubocop.yml** file.
8+
9+
### Installation
10+
11+
1. If you haven't already, [install the Code Climate CLI](https://github.com/codeclimate/codeclimate).
12+
2. Run `codeclimate engines:enable rubocop`. This command both installs the engine and enables it in your `.codeclimate.yml` file.
13+
3. You're ready to analyze! Browse into your project's folder and run `codeclimate analyze`.
14+
15+
### Need help?
16+
17+
For help with RuboCop, [check out their documentation](https://github.com/bbatsov/rubocop).
18+
19+
If you're running into a Code Climate issue, first look over this project's [GitHub Issues](https://github.com/codeclimate/codeclimate-rubocop/issues), as your question may have already been covered. If not, [go ahead and open a support ticket with us](https://codeclimate.com/help).

Rakefile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'rake/testtask'
2+
3+
Rake::TestTask.new do |t|
4+
t.test_files = Dir.glob('spec/**/*_spec.rb')
5+
t.libs = ["lib", "spec"]
6+
end
7+
8+
task(default: :test)

bin/codeclimate-rubocop

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env ruby
2+
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), "../lib")))
3+
4+
require 'cc/engine/rubocop'
5+
6+
CC::Engine::Rubocop.new("/code", ENV["ENGINE_CONFIG"], STDOUT).run

circle.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
machine:
2+
services:
3+
- docker
4+
environment:
5+
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
6+
image_name: codeclimate-rubocop
7+
8+
dependencies:
9+
pre:
10+
- echo $gcloud_json_key_base64 | sed 's/ //g' | base64 -d > /tmp/gcloud_key.json
11+
- curl https://sdk.cloud.google.com | bash
12+
- gcloud auth activate-service-account $gcloud_account_email --key-file /tmp/gcloud_key.json
13+
14+
test:
15+
override:
16+
- bundle exec rake
17+
18+
deployment:
19+
registry:
20+
branch: master
21+
commands:
22+
- gcloud preview docker -a
23+
- docker build -t=$registry_root/$image_name:b$CIRCLE_BUILD_NUM .
24+
- docker push $registry_root/$image_name:b$CIRCLE_BUILD_NUM

0 commit comments

Comments
 (0)