manageiq-style 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -1
- data/.github/workflows/ci.yaml +4 -4
- data/.yamllint +9 -0
- data/CHANGELOG.md +40 -0
- data/lib/manageiq/style/cli.rb +56 -13
- data/lib/manageiq/style/version.rb +1 -1
- data/manageiq-style.gemspec +3 -2
- data/styles/base.yml +2 -2
- data/styles/cc_base.yml +1 -2
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 990c9480ed907d42d8fc314a30dd34826cfe773de229db4ff9159e21df609fde
|
4
|
+
data.tar.gz: a4b0ee736be350a01d31bd0aaed575e4b9e55cfe53300b478c031fce2184f301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84d62a4be38cf15303b7ec1576311e242c787acfccc06a620d092f19231ba59b98efcfd43661e717cf9697af597d2c4052cf96658fe893313c687b3707024ac6
|
7
|
+
data.tar.gz: d61750885ba8c60c747e03f20839eac9151baf775bc4fd9c0c9069610303358471ddb03bd9b226915e3f06bdccc1383bd88721b3be144775c5ee046f9e6e9aee
|
data/.codeclimate.yml
CHANGED
data/.github/workflows/ci.yaml
CHANGED
@@ -12,14 +12,14 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
14
|
ruby-version:
|
15
|
-
- '2.5'
|
16
|
-
- '2.6'
|
17
15
|
- '2.7'
|
18
16
|
- '3.0'
|
17
|
+
- '3.1'
|
18
|
+
- '3.2'
|
19
19
|
env:
|
20
20
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
21
21
|
steps:
|
22
|
-
- uses: actions/checkout@
|
22
|
+
- uses: actions/checkout@v4
|
23
23
|
- name: Set up Ruby
|
24
24
|
uses: ruby/setup-ruby@v1
|
25
25
|
with:
|
@@ -31,4 +31,4 @@ jobs:
|
|
31
31
|
- name: Report code coverage
|
32
32
|
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}
|
33
33
|
continue-on-error: true
|
34
|
-
uses: paambaati/codeclimate-action@
|
34
|
+
uses: paambaati/codeclimate-action@v5
|
data/.yamllint
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [Unreleased]
|
6
|
+
|
7
|
+
## [1.4.0] - 2023-11-22
|
8
|
+
### Added
|
9
|
+
- Ensure .haml-lint.yml and .yamllint files [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
10
|
+
- Add lookup for existing rubocop channels [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Bump to rubocop 1.56.3 channel [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
14
|
+
- Bump to Ruby 2.7 [[#37](https://github.com/ManageIQ/manageiq-style/pull/37)]
|
15
|
+
|
16
|
+
## [1.3.3] - 2022-10-20
|
17
|
+
## [1.3.2] - 2022-06-21
|
18
|
+
## [1.3.1] - 2021-06-17
|
19
|
+
## [1.3.0] - 2021-04-27
|
20
|
+
## [1.2.0] - 2021-01-27
|
21
|
+
## [1.1.3] - 2021-01-05
|
22
|
+
## [1.1.2] - 2020-12-17
|
23
|
+
## [1.1.1] - 2020-11-10
|
24
|
+
## [1.0.1] - 2020-08-26
|
25
|
+
## [1.0.1] - 2020-06-19
|
26
|
+
## [1.0.0] - 2020-05-19
|
27
|
+
|
28
|
+
[Unreleased]: https://github.com/ManageIQ/more_core_extensions/compare/v1.4.0...HEAD
|
29
|
+
[1.4.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.3.3...v1.4.0
|
30
|
+
[1.3.3]: https://github.com/ManageIQ/more_core_extensions/compare/v1.3.2...v1.3.3
|
31
|
+
[1.3.2]: https://github.com/ManageIQ/more_core_extensions/compare/v1.3.1...v1.3.2
|
32
|
+
[1.3.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.3.0...v1.3.1
|
33
|
+
[1.3.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.2.0...v1.3.0
|
34
|
+
[1.2.0]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.3...v1.2.0
|
35
|
+
[1.1.3]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.2...v1.1.3
|
36
|
+
[1.1.2]: https://github.com/ManageIQ/more_core_extensions/compare/v1.1.1...v1.1.2
|
37
|
+
[1.1.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.1...v1.1.1
|
38
|
+
[1.0.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.1...v1.0.1
|
39
|
+
[1.0.1]: https://github.com/ManageIQ/more_core_extensions/compare/v1.0.0...v1.0.1
|
40
|
+
[1.0.0]: https://github.com/ManageIQ/more_core_extensions/tree/v1.0.0
|
data/lib/manageiq/style/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
module ManageIQ
|
2
4
|
module Style
|
3
5
|
class CLI
|
@@ -30,10 +32,14 @@ module ManageIQ
|
|
30
32
|
require 'more_core_extensions/all'
|
31
33
|
|
32
34
|
check_for_codeclimate_channel
|
35
|
+
|
33
36
|
update_rubocop_yml
|
34
37
|
write_rubocop_cc_yml
|
35
38
|
ensure_rubocop_local_yml_exists
|
36
39
|
update_codeclimate_yml
|
40
|
+
ensure_haml_lint_yml
|
41
|
+
update_yamllint
|
42
|
+
|
37
43
|
update_generator
|
38
44
|
update_gem_source
|
39
45
|
end
|
@@ -41,16 +47,28 @@ module ManageIQ
|
|
41
47
|
private
|
42
48
|
|
43
49
|
def check_for_codeclimate_channel
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
require 'open-uri'
|
51
|
+
uri = URI.parse("https://raw.githubusercontent.com/codeclimate/codeclimate-rubocop/channel/#{cc_rubocop_channel}/Gemfile")
|
52
|
+
uri.open
|
53
|
+
rescue OpenURI::HTTPError
|
54
|
+
STDERR.puts "RuboCop version #{rubocop_version.version} is not supported by CodeClimate."
|
55
|
+
STDERR.puts
|
56
|
+
STDERR.puts "Accepted versions are:"
|
57
|
+
fetch_all_codeclimate_channels.each_slice(10) do |versions|
|
58
|
+
STDERR.puts " #{versions.join(", ")}"
|
53
59
|
end
|
60
|
+
exit 1
|
61
|
+
end
|
62
|
+
|
63
|
+
def fetch_all_codeclimate_channels
|
64
|
+
`git ls-remote --heads https://github.com/codeclimate/codeclimate-rubocop 'channel/rubocop-*' 2>/dev/null`
|
65
|
+
.lines
|
66
|
+
.flat_map { |l| l.match(/rubocop-(.+)$/).captures }
|
67
|
+
.map { |v| v.split("-").join(".") }
|
68
|
+
.reject { |v| v == "1.70" } # This is not a real version, but the branch exists :shrug:
|
69
|
+
.sort_by { |v| v.split(".").map(&:to_i) }
|
70
|
+
rescue
|
71
|
+
[]
|
54
72
|
end
|
55
73
|
|
56
74
|
def update_rubocop_yml(file = ".rubocop.yml")
|
@@ -63,7 +81,7 @@ module ManageIQ
|
|
63
81
|
data.store_path("inherit_gem", "manageiq-style", ".rubocop_base.yml")
|
64
82
|
data["inherit_from"] = [".rubocop_local.yml"]
|
65
83
|
|
66
|
-
File.write(
|
84
|
+
File.write(file, data.to_yaml.sub("---\n", ""))
|
67
85
|
end
|
68
86
|
|
69
87
|
def write_rubocop_cc_yml(file = ".rubocop_cc.yml")
|
@@ -79,7 +97,6 @@ module ManageIQ
|
|
79
97
|
end
|
80
98
|
|
81
99
|
def ensure_rubocop_local_yml_exists(file = ".rubocop_local.yml")
|
82
|
-
require 'fileutils'
|
83
100
|
FileUtils.touch(file)
|
84
101
|
end
|
85
102
|
|
@@ -119,7 +136,33 @@ module ManageIQ
|
|
119
136
|
|
120
137
|
data["version"] ||= "2"
|
121
138
|
|
122
|
-
File.write(
|
139
|
+
File.write(file, data.to_yaml.sub("---\n", ""))
|
140
|
+
end
|
141
|
+
|
142
|
+
def ensure_haml_lint_yml(file = ".haml-lint.yml")
|
143
|
+
return if File.exist?(file)
|
144
|
+
|
145
|
+
FileUtils.ln_s(".rubocop.yml", file)
|
146
|
+
end
|
147
|
+
|
148
|
+
def update_yamllint(file = ".yamllint")
|
149
|
+
data = begin
|
150
|
+
YAML.load_file(file)
|
151
|
+
rescue Errno::ENOENT
|
152
|
+
{}
|
153
|
+
end
|
154
|
+
|
155
|
+
data["ignore"] ||= ""
|
156
|
+
data["ignore"] << "/locale/**\n" unless data["ignore"].include?("/locale/**")
|
157
|
+
data["ignore"] << "/vendor/**\n" unless data["ignore"].include?("/vendor/**")
|
158
|
+
data["ignore"].chomp!
|
159
|
+
|
160
|
+
data["extends"] = "relaxed"
|
161
|
+
|
162
|
+
data.store_path("rules", "indentation", "indent-sequences", false)
|
163
|
+
data.store_path("rules", "line-length", "max", 1000)
|
164
|
+
|
165
|
+
File.write(file, data.to_yaml.sub("---\n", ""))
|
123
166
|
end
|
124
167
|
|
125
168
|
def update_gem_source
|
@@ -213,7 +256,7 @@ module ManageIQ
|
|
213
256
|
indent = lines.first.match(/^\s+/).to_s
|
214
257
|
|
215
258
|
lines.map! { |l| l.strip.gsub(/[()]/, " ").split(" ", 3) } # Split to [prefix, gem, versions]
|
216
|
-
lines.each { |parts| parts[1].tr!("'", "\"")}
|
259
|
+
lines.each { |parts| parts[1].tr!("'", "\"") } # Ensure double quoted gem name
|
217
260
|
max_width = lines.map { |parts| parts[1].size }.max # Determine the widest gem name
|
218
261
|
lines.each { |parts| parts[1] = parts[1].ljust(max_width, " ") } # Apply the width
|
219
262
|
lines.map! { |parts| parts.join(" ").strip.insert(0, indent) << "\n" } # Back to strings
|
data/manageiq-style.gemspec
CHANGED
@@ -9,9 +9,10 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.description = spec.summary
|
10
10
|
spec.homepage = "https://github.com/ManageIQ/manageiq-style"
|
11
11
|
spec.license = "MIT"
|
12
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
13
13
|
|
14
14
|
spec.metadata["homepage_uri"] = spec.homepage
|
15
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
15
16
|
spec.metadata["source_code_uri"] = spec.homepage
|
16
17
|
|
17
18
|
# Specify which files should be added to the gem when it is released.
|
@@ -25,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
25
26
|
|
26
27
|
spec.add_runtime_dependency "more_core_extensions"
|
27
28
|
spec.add_runtime_dependency "optimist"
|
28
|
-
spec.add_runtime_dependency "rubocop", "
|
29
|
+
spec.add_runtime_dependency "rubocop", "= 1.56.3"
|
29
30
|
spec.add_runtime_dependency "rubocop-performance"
|
30
31
|
spec.add_runtime_dependency "rubocop-rails"
|
31
32
|
|
data/styles/base.yml
CHANGED
@@ -8,7 +8,7 @@ AllCops:
|
|
8
8
|
- spec/manageiq/**/*
|
9
9
|
- vendor/**/*
|
10
10
|
SuggestExtensions: false
|
11
|
-
TargetRubyVersion: 2.
|
11
|
+
TargetRubyVersion: 2.7
|
12
12
|
Layout/HashAlignment:
|
13
13
|
EnforcedHashRocketStyle: table
|
14
14
|
EnforcedColonStyle: table
|
@@ -120,7 +120,7 @@ Style/MethodCallWithArgsParentheses:
|
|
120
120
|
- lib/tasks/**/*
|
121
121
|
- spec/**/*
|
122
122
|
Enabled: true
|
123
|
-
|
123
|
+
AllowedMethods:
|
124
124
|
# Ruby
|
125
125
|
- add_dependency
|
126
126
|
- add_development_dependency
|
data/styles/cc_base.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manageiq-style
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ManageIQ Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: more_core_extensions
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '='
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.56.3
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.56.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rubocop-performance
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +140,8 @@ files:
|
|
140
140
|
- ".rubocop_cc_base.yml"
|
141
141
|
- ".rubocop_local.yml"
|
142
142
|
- ".whitesource"
|
143
|
+
- ".yamllint"
|
144
|
+
- CHANGELOG.md
|
143
145
|
- Gemfile
|
144
146
|
- LICENSE.txt
|
145
147
|
- README.md
|
@@ -159,6 +161,7 @@ licenses:
|
|
159
161
|
- MIT
|
160
162
|
metadata:
|
161
163
|
homepage_uri: https://github.com/ManageIQ/manageiq-style
|
164
|
+
rubygems_mfa_required: 'true'
|
162
165
|
source_code_uri: https://github.com/ManageIQ/manageiq-style
|
163
166
|
post_install_message:
|
164
167
|
rdoc_options: []
|
@@ -168,14 +171,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
171
|
requirements:
|
169
172
|
- - ">="
|
170
173
|
- !ruby/object:Gem::Version
|
171
|
-
version: 2.
|
174
|
+
version: 2.7.0
|
172
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
176
|
requirements:
|
174
177
|
- - ">="
|
175
178
|
- !ruby/object:Gem::Version
|
176
179
|
version: '0'
|
177
180
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
181
|
+
rubygems_version: 3.2.33
|
179
182
|
signing_key:
|
180
183
|
specification_version: 4
|
181
184
|
summary: Style and linting configuration for ManageIQ projects.
|