cconfig 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +24 -2
- data/.travis.yml +9 -4
- data/CHANGELOG.md +12 -5
- data/Gemfile +2 -0
- data/Gemfile.lock +30 -29
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/cconfig.gemspec +3 -3
- data/lib/cconfig.rb +2 -2
- data/lib/cconfig/cconfig.rb +3 -2
- data/lib/cconfig/errors.rb +2 -2
- data/lib/cconfig/hash_utils.rb +4 -5
- data/lib/cconfig/railtie.rb +4 -4
- data/lib/cconfig/version.rb +3 -3
- data/lib/tasks/info.rake +2 -2
- data/spec/config_spec.rb +19 -7
- data/spec/fixtures/config.yml +5 -0
- data/spec/hash_utils_spec.rb +6 -6
- data/spec/spec_helper.rb +2 -2
- metadata +5 -7
- data/.ruby-version +0 -1
- data/config/rubocop-suse.yml +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f2c9dc2ded01737e8e66212b7a1c17d16e8de42d4a61c518f7903a526513b6b5
|
4
|
+
data.tar.gz: 6d736ae908aab7fcc46cbbc3fb34254a6303f633de099db97f56ac5185e79fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a873d084f333d824fa6405ec88f9fccabe2399bda0fa1f556a983f60aaa28c2f1864061922db4e5c2a2e12bcb1edb89d8811faef56203718be2cfce8943b50cd
|
7
|
+
data.tar.gz: b05e76c6a8c7d445cda068e78e298c0d0bf670a7af37dce1f1a88f5ba6d035c1254d36c63284c0798057e4019f3da110d809ece9e7a44a060959c8c978994b03
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
require:
|
2
2
|
- rubocop-rspec
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
AllCops:
|
5
|
+
DisplayCopNames: true
|
6
|
+
DisplayStyleGuide: false
|
7
|
+
|
8
|
+
# This is a remnant of old SUSE-style alignment for hashes, The table format
|
9
|
+
# looks more human readable.
|
10
|
+
Layout/AlignHash:
|
11
|
+
EnforcedHashRocketStyle: table
|
12
|
+
EnforcedColonStyle: table
|
6
13
|
|
7
14
|
# Both my last names contain non-ascii characters :) (license notice)
|
8
15
|
Style/AsciiComments:
|
@@ -14,9 +21,24 @@ Metrics/BlockLength:
|
|
14
21
|
Exclude:
|
15
22
|
- spec/**/*
|
16
23
|
|
24
|
+
# The default is just too small. A limit of 100 looks reasonable and many other
|
25
|
+
# projects (including inside of SUSE) are also using this value.
|
26
|
+
Metrics/LineLength:
|
27
|
+
Max: 100
|
28
|
+
|
17
29
|
Metrics/MethodLength:
|
18
30
|
Max: 20
|
19
31
|
|
32
|
+
# This is a common SUSE configuration value: the performance difference between
|
33
|
+
# single and double quotes is no longer there, and so it's better to be
|
34
|
+
# consistent and force only double quotes.
|
35
|
+
Style/StringLiterals:
|
36
|
+
EnforcedStyle: double_quotes
|
37
|
+
|
38
|
+
# Same as Style/StringLiterals.
|
39
|
+
Style/StringLiteralsInInterpolation:
|
40
|
+
EnforcedStyle: double_quotes
|
41
|
+
|
20
42
|
# Sometimes we need more than one "expect" command to build our actual
|
21
43
|
# expectation.
|
22
44
|
RSpec/MultipleExpectations:
|
data/.travis.yml
CHANGED
@@ -5,12 +5,17 @@ cache: bundler
|
|
5
5
|
sudo: false
|
6
6
|
|
7
7
|
rvm:
|
8
|
-
- 2.1
|
9
|
-
- 2.2
|
10
|
-
- 2.3
|
11
|
-
- 2.4
|
8
|
+
- 2.1
|
9
|
+
- 2.2
|
10
|
+
- 2.3
|
11
|
+
- 2.4
|
12
|
+
- 2.5
|
13
|
+
- 2.6
|
12
14
|
- ruby-head
|
13
15
|
|
16
|
+
before_install:
|
17
|
+
- gem update --system
|
18
|
+
|
14
19
|
script:
|
15
20
|
- bundle exec rspec
|
16
21
|
- bundle exec rubocop -V
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## 1.2.1
|
4
|
+
|
5
|
+
- Added support for Ruby 2.5 and 2.6: nothing has really been done besides
|
6
|
+
adding 2.5 and 2.6 into the CI system and such.
|
7
|
+
- Fixed the `#enabled?` method for nested `enabled` directives. See
|
8
|
+
[commit](ec0d01c153d5157b08865821b9c679eeae450c35).
|
4
9
|
|
5
10
|
## 1.2.0
|
6
11
|
|
7
12
|
- Added the `#default_of` method for the returned hash (hence `APP_CONFIG` as
|
8
13
|
well). This method returns the default value for a given key. It can be useful
|
9
14
|
to check whether a configuration value has been set by either environment
|
10
|
-
variables or the local configuration. See
|
15
|
+
variables or the local configuration. See
|
16
|
+
[commit](50d638c8d81bab6b17164a1a5661dc2ca730cf92).
|
11
17
|
|
12
18
|
## 1.1.1
|
13
19
|
|
14
|
-
- Fixed crash on nested values on the `#enabled?` method. See
|
20
|
+
- Fixed crash on nested values on the `#enabled?` method. See
|
21
|
+
[#3](https://github.com/mssola/cconfig/issues/3).
|
15
22
|
- The `prefix` argument from the constructor now takes a default
|
16
23
|
(`cconfig`). This will make things more predictable I hope.
|
17
24
|
|
@@ -22,8 +29,8 @@
|
|
22
29
|
## 1.0.0
|
23
30
|
|
24
31
|
- First release which includes the following features:
|
25
|
-
- You can have a `config.yml` and a `config-local.yml` file. The first file
|
26
|
-
|
32
|
+
- You can have a `config.yml` and a `config-local.yml` file. The first file is
|
33
|
+
the reference configuration, while the other overwrites it with the given
|
27
34
|
values.
|
28
35
|
- You can override either the `config.yml` and the `config-local.yml` files
|
29
36
|
with environment variables that start with a given prefix.
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,46 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cconfig (1.2.
|
4
|
+
cconfig (1.2.1)
|
5
5
|
safe_yaml (~> 1.0.0, >= 1.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ast (2.
|
10
|
+
ast (2.4.0)
|
11
11
|
diff-lcs (1.3)
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
rake (12.
|
19
|
-
rspec (3.
|
20
|
-
rspec-core (~> 3.
|
21
|
-
rspec-expectations (~> 3.
|
22
|
-
rspec-mocks (~> 3.
|
23
|
-
rspec-core (3.
|
24
|
-
rspec-support (~> 3.
|
25
|
-
rspec-expectations (3.
|
12
|
+
jaro_winkler (1.5.1)
|
13
|
+
parallel (1.12.1)
|
14
|
+
parser (2.5.3.0)
|
15
|
+
ast (~> 2.4.0)
|
16
|
+
powerpack (0.1.2)
|
17
|
+
rainbow (3.0.0)
|
18
|
+
rake (12.3.1)
|
19
|
+
rspec (3.8.0)
|
20
|
+
rspec-core (~> 3.8.0)
|
21
|
+
rspec-expectations (~> 3.8.0)
|
22
|
+
rspec-mocks (~> 3.8.0)
|
23
|
+
rspec-core (3.8.0)
|
24
|
+
rspec-support (~> 3.8.0)
|
25
|
+
rspec-expectations (3.8.2)
|
26
26
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.
|
28
|
-
rspec-mocks (3.
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-mocks (3.8.0)
|
29
29
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-support (3.
|
32
|
-
rubocop (0.
|
30
|
+
rspec-support (~> 3.8.0)
|
31
|
+
rspec-support (3.8.0)
|
32
|
+
rubocop (0.57.2)
|
33
|
+
jaro_winkler (~> 1.5.1)
|
33
34
|
parallel (~> 1.10)
|
34
|
-
parser (>= 2.
|
35
|
+
parser (>= 2.5)
|
35
36
|
powerpack (~> 0.1)
|
36
|
-
rainbow (>=
|
37
|
+
rainbow (>= 2.2.2, < 4.0)
|
37
38
|
ruby-progressbar (~> 1.7)
|
38
39
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
39
|
-
rubocop-rspec (1.
|
40
|
-
rubocop (>= 0.
|
41
|
-
ruby-progressbar (1.
|
40
|
+
rubocop-rspec (1.27.0)
|
41
|
+
rubocop (>= 0.56.0)
|
42
|
+
ruby-progressbar (1.10.0)
|
42
43
|
safe_yaml (1.0.4)
|
43
|
-
unicode-display_width (1.
|
44
|
+
unicode-display_width (1.4.0)
|
44
45
|
|
45
46
|
PLATFORMS
|
46
47
|
ruby
|
@@ -50,8 +51,8 @@ DEPENDENCIES
|
|
50
51
|
cconfig!
|
51
52
|
rake (>= 10.0)
|
52
53
|
rspec (>= 3.0)
|
53
|
-
rubocop (~> 0.
|
54
|
+
rubocop (~> 0.57.0)
|
54
55
|
rubocop-rspec
|
55
56
|
|
56
57
|
BUNDLED WITH
|
57
|
-
1.
|
58
|
+
1.16.5
|
data/README.md
CHANGED
@@ -122,7 +122,7 @@ This project is based on work I did for the
|
|
122
122
|
gem so it can be also used for other projects that might be interested in this.
|
123
123
|
|
124
124
|
```
|
125
|
-
Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
125
|
+
Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
126
126
|
|
127
127
|
CConfig is free software: you can redistribute it and/or modify
|
128
128
|
it under the terms of the GNU Lesser General Public License as published by
|
data/Rakefile
CHANGED
data/cconfig.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
lib = File.expand_path("
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
|
6
6
|
require "cconfig/version"
|
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "bundler", ">= 1.0.0"
|
27
27
|
spec.add_development_dependency "rake", ">= 10.0"
|
28
28
|
spec.add_development_dependency "rspec", ">= 3.0"
|
29
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
29
|
+
spec.add_development_dependency "rubocop", "~> 0.57.0"
|
30
30
|
spec.add_development_dependency "rubocop-rspec"
|
31
31
|
end
|
data/lib/cconfig.rb
CHANGED
data/lib/cconfig/cconfig.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -66,6 +66,7 @@ module CConfig
|
|
66
66
|
# Check for bad user input in the local config.yml file.
|
67
67
|
local = YAML.load_file(@local)
|
68
68
|
raise FormatError unless local.is_a?(::Hash)
|
69
|
+
|
69
70
|
local
|
70
71
|
else
|
71
72
|
{}
|
data/lib/cconfig/errors.rb
CHANGED
data/lib/cconfig/hash_utils.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -39,10 +39,9 @@ module CConfig
|
|
39
39
|
parts.each do |part|
|
40
40
|
cur = cur[part]
|
41
41
|
return false if !cur || cur.empty?
|
42
|
-
return true if cur.key?("enabled") && cur["enabled"].eql?(true)
|
43
42
|
end
|
44
43
|
|
45
|
-
|
44
|
+
cur.key?("enabled") && cur["enabled"].eql?(true)
|
46
45
|
end
|
47
46
|
|
48
47
|
# Returns true if the given feature is disabled or doesn't exist. This is
|
@@ -58,7 +57,7 @@ module CConfig
|
|
58
57
|
|
59
58
|
key.split(".").each do |part|
|
60
59
|
cur = cur[part]
|
61
|
-
|
60
|
+
break if cur.nil?
|
62
61
|
end
|
63
62
|
|
64
63
|
cur
|
data/lib/cconfig/railtie.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -29,8 +29,8 @@ module CConfig
|
|
29
29
|
|
30
30
|
initializer "cconfig" do |app|
|
31
31
|
prefix = ENV["CCONFIG_PREFIX"] || app.class.parent_name.inspect
|
32
|
-
default =
|
33
|
-
local =
|
32
|
+
default = Rails.root.join("config", "config.yml")
|
33
|
+
local = Rails.root.join("config", "config-local.yml")
|
34
34
|
cfg = ::CConfig::Config.new(default: default, local: local, prefix: prefix)
|
35
35
|
|
36
36
|
# NOTE: this is a global constant from now on. The Rails application
|
data/lib/cconfig/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -19,5 +19,5 @@
|
|
19
19
|
|
20
20
|
module CConfig
|
21
21
|
# The current version of CConfig.
|
22
|
-
VERSION = "1.2.
|
22
|
+
VERSION = "1.2.1".freeze
|
23
23
|
end
|
data/lib/tasks/info.rake
CHANGED
data/spec/config_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -29,8 +29,8 @@ end
|
|
29
29
|
|
30
30
|
describe CConfig::Config do
|
31
31
|
after do
|
32
|
-
[
|
33
|
-
[
|
32
|
+
%w[TEST_LOCAL_CONFIG_PATH TEST_EMAIL_SMTP_ENABLED].each { |key| ENV[key] = nil }
|
33
|
+
%w[TEST_LDAP_COUNT TEST_ANOTHER_ENABLED TEST_LDAP_STRING].each do |key|
|
34
34
|
ENV[key] = nil
|
35
35
|
end
|
36
36
|
end
|
@@ -61,8 +61,8 @@ describe CConfig::Config do
|
|
61
61
|
it "merges both config files and work as expected" do
|
62
62
|
cfg = get_config("config.yml", "local.yml").fetch
|
63
63
|
|
64
|
-
expect(cfg.
|
65
|
-
expect(cfg.
|
64
|
+
expect(cfg).to be_enabled("gravatar")
|
65
|
+
expect(cfg).to be_enabled("ldap")
|
66
66
|
expect(cfg["ldap"]["hostname"]).to eq "ldap.example.com"
|
67
67
|
expect(cfg["ldap"]["port"]).to eq 389
|
68
68
|
expect(cfg["ldap"]["base"]).to eq "ou=users,dc=example,dc=com"
|
@@ -92,9 +92,21 @@ describe CConfig::Config do
|
|
92
92
|
expect(cfg.enabled?("email.smtp")).to be true
|
93
93
|
end
|
94
94
|
|
95
|
+
it "works with environment variables" do
|
96
|
+
ENV["TEST_EMAIL_SMTP_ENABLED"] = "false"
|
97
|
+
cfg = get_config("config.yml", "").fetch
|
98
|
+
expect(cfg.enabled?("email.smtp")).to be false
|
99
|
+
end
|
100
|
+
|
95
101
|
it "offers the #disabled? method" do
|
96
102
|
cfg = get_config("config.yml", "").fetch
|
97
|
-
expect(cfg.
|
103
|
+
expect(cfg).to be_disabled("ldap")
|
104
|
+
end
|
105
|
+
|
106
|
+
it "handles enabled on nested elements" do
|
107
|
+
cfg = get_config("config.yml", "").fetch
|
108
|
+
expect(cfg).to be_enabled("delete")
|
109
|
+
expect(cfg).to be_disabled("delete.garbage_collector")
|
98
110
|
end
|
99
111
|
end
|
100
112
|
|
data/spec/fixtures/config.yml
CHANGED
data/spec/hash_utils_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright (C) 2017 Miquel Sabaté Solà <msabate@suse.com>
|
3
|
+
# Copyright (C) 2017-2018 Miquel Sabaté Solà <msabate@suse.com>
|
4
4
|
#
|
5
5
|
# This file is part of CConfig.
|
6
6
|
#
|
@@ -27,7 +27,7 @@ end
|
|
27
27
|
|
28
28
|
describe ::CConfig::HashUtils do
|
29
29
|
after do
|
30
|
-
[
|
30
|
+
%w[TEST_LDAP_COUNT TEST_ANOTHER_ENABLED TEST_LDAP_STRING].each do |key|
|
31
31
|
ENV[key] = nil
|
32
32
|
end
|
33
33
|
end
|
@@ -71,8 +71,8 @@ describe ::CConfig::HashUtils do
|
|
71
71
|
cfg = ConfigMock.new.strict_merge_with_env_test(default: default, local: local, prefix: "test")
|
72
72
|
|
73
73
|
cfg.extend(::CConfig::HashUtils::Extensions)
|
74
|
-
expect(cfg.
|
75
|
-
expect(cfg.
|
76
|
-
expect(cfg.
|
74
|
+
expect(cfg).to be_enabled("gravatar")
|
75
|
+
expect(cfg).not_to be_enabled("oauth.google_oauth2")
|
76
|
+
expect(cfg).not_to be_enabled("something.that.does.not.exist")
|
77
77
|
end
|
78
78
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mssola
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|
@@ -78,14 +78,14 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0.
|
81
|
+
version: 0.57.0
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0.
|
88
|
+
version: 0.57.0
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rubocop-rspec
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +110,6 @@ files:
|
|
110
110
|
- ".gitignore"
|
111
111
|
- ".rspec"
|
112
112
|
- ".rubocop.yml"
|
113
|
-
- ".ruby-version"
|
114
113
|
- ".travis.yml"
|
115
114
|
- CHANGELOG.md
|
116
115
|
- CONTRIBUTING.md
|
@@ -121,7 +120,6 @@ files:
|
|
121
120
|
- README.md
|
122
121
|
- Rakefile
|
123
122
|
- cconfig.gemspec
|
124
|
-
- config/rubocop-suse.yml
|
125
123
|
- lib/cconfig.rb
|
126
124
|
- lib/cconfig/cconfig.rb
|
127
125
|
- lib/cconfig/errors.rb
|
@@ -155,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
153
|
version: '0'
|
156
154
|
requirements: []
|
157
155
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.
|
156
|
+
rubygems_version: 2.7.3
|
159
157
|
signing_key:
|
160
158
|
specification_version: 4
|
161
159
|
summary: Configuration management for container-aware applications.
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.10
|
data/config/rubocop-suse.yml
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
# This is the shared Rubocop configuration for SUSE projects. It is maintained
|
2
|
-
# at https://github.com/SUSE/style-guides/blob/master/rubocop-suse.yml
|
3
|
-
#
|
4
|
-
# The configuration is tested and used with the Rubocop version used by Hound
|
5
|
-
# (https://houndci.com).
|
6
|
-
#
|
7
|
-
# We use the default Hound config as a baseline:
|
8
|
-
#
|
9
|
-
# https://raw.githubusercontent.com/thoughtbot/hound/master/config/style_guides/ruby.yml
|
10
|
-
#
|
11
|
-
# This file contains the rules with derive from this.
|
12
|
-
|
13
|
-
Lint/EndAlignment:
|
14
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#lintendalignment
|
15
|
-
EnforcedStyleAlignWith: variable
|
16
|
-
|
17
|
-
Metrics/AbcSize:
|
18
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricsabcsize
|
19
|
-
Max: 30
|
20
|
-
|
21
|
-
Metrics/LineLength:
|
22
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength
|
23
|
-
Max: 100
|
24
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
25
|
-
# contaning a URI to be longer than Max.
|
26
|
-
AllowURI: true
|
27
|
-
URISchemes:
|
28
|
-
- http
|
29
|
-
- https
|
30
|
-
|
31
|
-
Layout/AlignHash:
|
32
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignhash
|
33
|
-
EnforcedHashRocketStyle: table
|
34
|
-
EnforcedColonStyle: table
|
35
|
-
|
36
|
-
Layout/AlignParameters:
|
37
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylealignparameters
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Style/CollectionMethods:
|
41
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylecollectionmethods
|
42
|
-
Enabled: false
|
43
|
-
|
44
|
-
Layout/EmptyLinesAroundBlockBody:
|
45
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#styleemptylinesaroundblockbody
|
46
|
-
Enabled: false
|
47
|
-
|
48
|
-
Layout/MultilineOperationIndentation:
|
49
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylemultilineoperationindentation
|
50
|
-
EnforcedStyle: indented
|
51
|
-
|
52
|
-
Style/StringLiterals:
|
53
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliterals
|
54
|
-
EnforcedStyle: double_quotes
|
55
|
-
|
56
|
-
Style/StringLiteralsInInterpolation:
|
57
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylestringliteralsininterpolation
|
58
|
-
EnforcedStyle: double_quotes
|
59
|
-
|
60
|
-
Style/WordArray:
|
61
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
|
62
|
-
Enabled: false
|
63
|
-
|
64
|
-
Style/RegexpLiteral:
|
65
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#deviations-from-the-upstream-style-guide
|
66
|
-
Enabled: false
|
67
|
-
|
68
|
-
Style/SignalException:
|
69
|
-
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
70
|
-
EnforcedStyle: only_raise
|
71
|
-
|
72
|
-
Style/NumericLiterals:
|
73
|
-
StyleGuide: https://github.com/SUSE/style-guides/blob/master/Ruby.md#stylenumericliterals
|
74
|
-
Enabled: false
|