-
Notifications
You must be signed in to change notification settings - Fork 4
/
finstyle.rb
35 lines (29 loc) · 927 Bytes
/
finstyle.rb
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
# -*- encoding: utf-8 -*-
require "finstyle/version"
# ensure the desired target version of RuboCop is gem activated
gem "rubocop", "= #{Finstyle::RUBOCOP_VERSION}"
require "rubocop"
# Honestly, this is generally **not** a good idea and takes advantage of
# non-frozen strings being used for constant values upstream. Remember, with
# Ruby's great power comes great responsibility.
module RuboCop
class ConfigLoader
RUBOCOP_HOME.gsub!(
/^.*$/,
File.realpath(File.join(File.dirname(__FILE__), ".."))
)
DEFAULT_FILE.gsub!(
/^.*$/,
File.join(RUBOCOP_HOME, "config", "default.yml")
)
end
end
# Finstyle patches the RuboCop tool to set a new default configuration that
# is vendored in the Finstyle codebase.
module Finstyle
# @return [String] the absolute path to the main RuboCop configuration YAML
# file
def self.config
RuboCop::ConfigLoader::DEFAULT_FILE
end
end