Skip to content

Commit 2349981

Browse files
authored
Merge pull request #46 from mtsmfm/rubocop
��Run Rubocop on CI
2 parents d4b5826 + 9176ddd commit 2349981

File tree

29 files changed

+350
-282
lines changed

29 files changed

+350
-282
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
/tmp/
1010
/vendor/bundle/
1111
/node_modules/
12+
/.rubocop-*

.rubocop.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
inherit_from:
2+
- https://github.com/onk/onkcop/raw/v0.51.0.0/config/rubocop.yml
3+
4+
AllCops:
5+
TargetRubyVersion: 2.2
6+
Exclude:
7+
- 'bin/**/*'
8+
9+
# TODO: Remove this config after droping Ruby 2.2 support
10+
Layout/IndentHeredoc:
11+
Include:
12+
- 'test/**/*'
13+
14+
Lint/AssignmentInCondition:
15+
Enabled: false
16+
17+
Lint/HandleExceptions:
18+
Enabled: false
19+
20+
Naming/HeredocDelimiterNaming:
21+
Enabled: false
22+
23+
Style/BlockDelimiters:
24+
Enabled: false
25+
26+
Style/MultilineBlockChain:
27+
Enabled: false
28+
29+
Style/Semicolon:
30+
Enabled: false
31+
32+
Metrics/AbcSize:
33+
Max: 50
34+
35+
Metrics/BlockLength:
36+
Max: 30
37+
38+
Metrics/MethodLength:
39+
Max: 40
40+
41+
Metrics/ModuleLength:
42+
Enabled: false
43+
44+
Metrics/LineLength:
45+
Max: 200

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
source 'https://rubygems.org'
1+
source "https://rubygems.org"
22

33
# Specify your gem's dependencies in language_server.gemspec
44
gemspec
55

66
# TODO: Use released gem after new release includes https://github.com/bbatsov/rubocop/pull/4987
7-
gem 'rubocop', git: 'https://github.com/bbatsov/rubocop'
7+
gem "rubocop", git: "https://github.com/bbatsov/rubocop"

Guardfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ guard :minitest, all_after_pass: true do
55
watch(%r{^test/(.*)\/?test_(.*)\.rb$})
66
watch(%r{^test/(.*)\/?(.*)_test\.rb$})
77
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
8-
watch(%r{^test/test_helper\.rb$}) { 'test' }
8+
watch(%r{^test/test_helper\.rb$}) { "test" }
99
end

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ require "rake/testtask"
44
Rake::TestTask.new(:test) do |t|
55
t.libs << "test"
66
t.libs << "lib"
7-
t.test_files = FileList['test/**/*_test.rb']
7+
t.test_files = FileList["test/**/*_test.rb"]
88
end
99

1010
task :default => :test

benchmark/rubocop

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
22

3-
require 'bundler/setup'
4-
require 'benchmark/ips'
5-
require 'language_server'
3+
require "bundler/setup"
4+
require "benchmark/ips"
5+
require "language_server"
66

77
error_code = <<-EOS
88
require "foo
@@ -13,7 +13,7 @@ a = 1
1313
EOS
1414
valid_code = File.read(__FILE__)
1515

16-
require 'pry-byebug'
16+
require "pry-byebug"
1717

1818
LanguageServer::Linter::Rubocop.new(valid_code).call
1919
Benchmark.ips do |x|

benchmark/ruby_wc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env ruby
22

3-
require 'bundler/setup'
4-
require 'benchmark/ips'
5-
require 'language_server'
3+
require "bundler/setup"
4+
require "benchmark/ips"
5+
require "language_server"
66

77
error_code = <<-EOS
88
require "foo

bin/ci

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env sh
2+
3+
set -ex
4+
5+
bin/setup
6+
bin/rubocop
7+
bin/m

bin/rubocop

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
#
4+
# This file was generated by Bundler.
5+
#
6+
# The application 'rubocop' is installed as part of a gem, and
7+
# this file is here to facilitate running it.
8+
#
9+
10+
require "pathname"
11+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
12+
Pathname.new(__FILE__).realpath)
13+
14+
require "rubygems"
15+
require "bundler/setup"
16+
17+
load Gem.bin_path("rubocop", "rubocop")

circle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ jobs:
2020
docker cp . project:/app
2121
docker start project
2222
docker-compose build $SERVICE_NAME
23-
- run: docker-compose run $SERVICE_NAME bin/setup
24-
- run: docker-compose run $SERVICE_NAME bin/m
23+
- run: docker-compose run $SERVICE_NAME bin/ci
2524
test-2-3:
2625
<<: *test
2726
docker:

0 commit comments

Comments
 (0)