manageiq-style 1.3.3 → 1.5.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 -5
- data/.yamllint +9 -0
- data/CHANGELOG.md +45 -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: 4b8574cc9a7ed1afc23082249a4c9d0ff34dbbc037319ac22abf7828667b3276
|
4
|
+
data.tar.gz: 3f576a96479b3c3ab2b1dcd867eb17b48193fe250b59451486f8cca6d121ceda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46772bcac697ab5243e34f8b03b4f9e850901a91d1a7d3abb14c68eb6d3b01dfe726baf9e58373720c033dfbade649038aa2b1f9fcf0b0d1c078466771e384c5
|
7
|
+
data.tar.gz: f37d8efac6eea06737368bdf73e772efbb31886262f9fa93230a7c852cee974e96d3e93761e06e4bb9447a8ebedeb0fd9d6cd33c72ac73a3f01b11227f5cc125
|
data/.codeclimate.yml
CHANGED
data/.github/workflows/ci.yaml
CHANGED
@@ -12,14 +12,13 @@ jobs:
|
|
12
12
|
strategy:
|
13
13
|
matrix:
|
14
14
|
ruby-version:
|
15
|
-
- '2.5'
|
16
|
-
- '2.6'
|
17
|
-
- '2.7'
|
18
15
|
- '3.0'
|
16
|
+
- '3.1'
|
17
|
+
- '3.2'
|
19
18
|
env:
|
20
19
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
21
20
|
steps:
|
22
|
-
- uses: actions/checkout@
|
21
|
+
- uses: actions/checkout@v4
|
23
22
|
- name: Set up Ruby
|
24
23
|
uses: ruby/setup-ruby@v1
|
25
24
|
with:
|
@@ -31,4 +30,4 @@ jobs:
|
|
31
30
|
- name: Report code coverage
|
32
31
|
if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.0' }}
|
33
32
|
continue-on-error: true
|
34
|
-
uses: paambaati/codeclimate-action@
|
33
|
+
uses: paambaati/codeclimate-action@v5
|
data/.yamllint
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,45 @@
|
|
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.5.0] - 2024-02-28
|
8
|
+
### Changed
|
9
|
+
- Change TargetRubyVersion to 3.0 [[#42](https://github.com/ManageIQ/manageiq-style/pull/42)]
|
10
|
+
- Drop Ruby 2.7 [[#43](https://github.com/ManageIQ/manageiq-style/pull/43)]
|
11
|
+
## [1.4.0] - 2023-11-22
|
12
|
+
### Added
|
13
|
+
- Ensure .haml-lint.yml and .yamllint files [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
14
|
+
- Add lookup for existing rubocop channels [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
- Bump to rubocop 1.56.3 channel [[#39](https://github.com/ManageIQ/manageiq-style/pull/39)]
|
18
|
+
- Bump to Ruby 2.7 [[#37](https://github.com/ManageIQ/manageiq-style/pull/37)]
|
19
|
+
|
20
|
+
## [1.3.3] - 2022-10-20
|
21
|
+
## [1.3.2] - 2022-06-21
|
22
|
+
## [1.3.1] - 2021-06-17
|
23
|
+
## [1.3.0] - 2021-04-27
|
24
|
+
## [1.2.0] - 2021-01-27
|
25
|
+
## [1.1.3] - 2021-01-05
|
26
|
+
## [1.1.2] - 2020-12-17
|
27
|
+
## [1.1.1] - 2020-11-10
|
28
|
+
## [1.0.1] - 2020-08-26
|
29
|
+
## [1.0.1] - 2020-06-19
|
30
|
+
## [1.0.0] - 2020-05-19
|
31
|
+
|
32
|
+
[Unreleased]: https://github.com/ManageIQ/manageiq-style/compare/v1.5.0...HEAD
|
33
|
+
[1.5.0]: https://github.com/ManageIQ/manageiq-style/compare/v1.4.0...v1.5.0
|
34
|
+
[1.4.0]: https://github.com/ManageIQ/manageiq-style/compare/v1.3.3...v1.4.0
|
35
|
+
[1.3.3]: https://github.com/ManageIQ/manageiq-style/compare/v1.3.2...v1.3.3
|
36
|
+
[1.3.2]: https://github.com/ManageIQ/manageiq-style/compare/v1.3.1...v1.3.2
|
37
|
+
[1.3.1]: https://github.com/ManageIQ/manageiq-style/compare/v1.3.0...v1.3.1
|
38
|
+
[1.3.0]: https://github.com/ManageIQ/manageiq-style/compare/v1.2.0...v1.3.0
|
39
|
+
[1.2.0]: https://github.com/ManageIQ/manageiq-style/compare/v1.1.3...v1.2.0
|
40
|
+
[1.1.3]: https://github.com/ManageIQ/manageiq-style/compare/v1.1.2...v1.1.3
|
41
|
+
[1.1.2]: https://github.com/ManageIQ/manageiq-style/compare/v1.1.1...v1.1.2
|
42
|
+
[1.1.1]: https://github.com/ManageIQ/manageiq-style/compare/v1.0.1...v1.1.1
|
43
|
+
[1.0.1]: https://github.com/ManageIQ/manageiq-style/compare/v1.0.1...v1.0.1
|
44
|
+
[1.0.1]: https://github.com/ManageIQ/manageiq-style/compare/v1.0.0...v1.0.1
|
45
|
+
[1.0.0]: https://github.com/ManageIQ/manageiq-style/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(">=
|
12
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.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:
|
11
|
+
TargetRubyVersion: 3.0
|
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.5.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: 2024-02-28 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:
|
174
|
+
version: 3.0.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.3.
|
181
|
+
rubygems_version: 3.3.26
|
179
182
|
signing_key:
|
180
183
|
specification_version: 4
|
181
184
|
summary: Style and linting configuration for ManageIQ projects.
|