caliber 0.51.0 → 0.53.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fff7e5a660df0819409521f6ee3340920b1fb133fc9ed8191c24031da849b654
4
- data.tar.gz: 6e019c4d292014b27b5780138bfe4d154840bb8416e0e76ee4be40fa7465251a
3
+ metadata.gz: '094cc03724281ebb129a840e56fee7aaa83fb3eb201d772ea031b995c91c9426'
4
+ data.tar.gz: d79154ecde3c059cb37ab4ae304621d2466460a193c032612d3d022096851991
5
5
  SHA512:
6
- metadata.gz: f96b76b784ff63835d1ebf6271eab98c7315212b6428f626ecbe8383160df63475f27a550b15c8ab9e8bcc0237325965cb07692fe297d01b358c84d41dcac316
7
- data.tar.gz: df5e7920c03d57bd21399d7a3fa3821bb202474a918d5f964c6723694ce4be62f52d15b69a0752a61e4d771c368c6175b8faba8cf7cf17241f96eb48a23f9779
6
+ metadata.gz: 2c0e098a9eb8c7c9fc041cbc2560ec8bd8062cab4634d9467fc2f1b66dd98ea42c8691377e0ef650099af9327ac1a53eaac0826154209e393bdb4c29c7a184df
7
+ data.tar.gz: 3749c4b0f5a31013848f914d9b71f6f427de6fef6fe5aca67e0274cba8a0d3e0d72b66329d7ba3fa70ff70f05ad06a4e915dd9a7dea850dc6d3ee68dd71390cc
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -2,15 +2,16 @@
2
2
  :toclevels: 5
3
3
  :figure-caption!:
4
4
 
5
- :rubocop_link: link:https://docs.rubocop.org/rubocop[RuboCop]
6
5
  :rubocop_capybara_link: link:https://docs.rubocop.org/rubocop-capybara[RuboCop Capybara]
7
6
  :rubocop_disable_syntax_link: link:https://github.com/fatkodima/rubocop-disable_syntax[RuboCop Disable Syntax]
8
7
  :rubocop_factory_bot_link: link:https://docs.rubocop.org/rubocop-factory_bot/[RuboCop FactoryBot]
8
+ :rubocop_link: link:https://docs.rubocop.org/rubocop[RuboCop]
9
9
  :rubocop_packaging_link: link:https://docs.rubocop.org/rubocop-packaging[RuboCop Packaging]
10
10
  :rubocop_performance_link: link:https://docs.rubocop.org/rubocop-performance[RuboCop Performance]
11
- :rubocop_thread_safety_link: link:https://github.com/rubocop/rubocop-thread_safety[RuboCop Thread Safety]
12
11
  :rubocop_rake_link: link:https://docs.rubocop.org/rubocop-rspec[RuboCop Rake]
13
12
  :rubocop_rspec_link: link:https://docs.rubocop.org/rubocop-rspec[RuboCop RSpec]
13
+ :rubocop_thread_safety_link: link:https://github.com/rubocop/rubocop-thread_safety[RuboCop Thread Safety]
14
+ :xdg_configuration_link: link:https://alchemists.io/articles/xdg_base_directory_specification[XDG Base Directory Specification]
14
15
 
15
16
  = Caliber
16
17
 
@@ -291,6 +292,26 @@ require:
291
292
 
292
293
  Adding additional RuboCop gems only requires adding them to your YAML configuration.
293
294
 
295
+ === Command Line Interface (CLI)
296
+
297
+ ⚠️ This is experimental but might be of interest to anyone using RuboCop's local {xdg_configuration_link} (highly recommend).
298
+
299
+ At the moment, RuboCop doesn't have native functionality for handling these updates and this CLI is one solution to that problem (see this link:https://github.com/rubocop/rubocop/issues/12729[issue] for details). So this CLI automates the updating of outstanding issues you have not resolved for your RuboCop configuration (i.e. `.rubocop_todo.yml`) and is handy when you've fixed issues and want to update your configuration to reflect these changes. The CLI assumes you are using the following structure:
300
+
301
+ ....
302
+ .config/rubocop/config.yml
303
+ .config/rubocop/issues.yml
304
+ ....
305
+
306
+ ...and that you have this line in `.config/rubocop/config.yml`:
307
+
308
+ [source,yaml]
309
+ ----
310
+ inherit_from: issues.yml
311
+ ----
312
+
313
+ Assuming the above is true, you can run the `caliber` CLI and follow the prompts for either updating your outstanding issues or exiting. Upon competition, the CLI will update your `.config/rubocop/issues.yml` so you can commit these updates/changes to your repository.
314
+
294
315
  == Development
295
316
 
296
317
  To contribute, run:
data/caliber.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "caliber"
5
- spec.version = "0.51.0"
5
+ spec.version = "0.53.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/caliber"
@@ -26,11 +26,13 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "rubocop", "~> 1.61"
27
27
  spec.add_dependency "rubocop-disable_syntax", "~> 0.1"
28
28
  spec.add_dependency "rubocop-packaging", "~> 0.5"
29
- spec.add_dependency "rubocop-performance", "~> 1.20"
29
+ spec.add_dependency "rubocop-performance", "~> 1.21"
30
30
  spec.add_dependency "rubocop-rake", "~> 0.6"
31
- spec.add_dependency "rubocop-rspec", "~> 2.27"
31
+ spec.add_dependency "rubocop-rspec", "~> 2.28"
32
32
  spec.add_dependency "rubocop-thread_safety", "~> 0.5"
33
33
 
34
+ spec.bindir = "exe"
35
+ spec.executables << "caliber"
34
36
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
35
37
  spec.files = Dir["*.gemspec", "config/**/*", "lib/**/*"]
36
38
  end
data/config/rspec.yml CHANGED
@@ -84,18 +84,18 @@ RSpec/RemoveConst:
84
84
  Enabled: true
85
85
  RSpec/RepeatedSubjectCall:
86
86
  Enabled: true
87
- RSpec/Rails/AvoidSetupHook:
87
+ RSpecRails/AvoidSetupHook:
88
88
  Enabled: true
89
- RSpec/Rails/HaveHttpStatus:
89
+ RSpecRails/HaveHttpStatus:
90
90
  Enabled: true
91
- RSpec/Rails/InferredSpecType:
91
+ RSpecRails/InferredSpecType:
92
92
  Enabled: true
93
- RSpec/Rails/MinitestAssertions:
93
+ RSpecRails/MinitestAssertions:
94
94
  Enabled: true
95
- RSpec/Rails/NegationBeValid:
95
+ RSpecRails/NegationBeValid:
96
96
  Enabled: true
97
97
  EnforcedStyle: be_invalid
98
- RSpec/Rails/TravelAround:
98
+ RSpecRails/TravelAround:
99
99
  Enabled: true
100
100
  RSpec/SkipBlockInsideExample:
101
101
  Enabled: true
data/exe/caliber ADDED
@@ -0,0 +1,82 @@
1
+ #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "pathname"
5
+
6
+ PATHS = {
7
+ xdg_config: ".config/rubocop/config.yml",
8
+ xdg_issues: ".config/rubocop/issues.yml",
9
+ config: ".rubocop.yml",
10
+ todo: ".rubocop_todo.yml"
11
+ }.freeze
12
+
13
+ class Updater
14
+ def initialize root: Pathname.pwd, paths: PATHS
15
+ @root = root
16
+ @paths = paths
17
+ end
18
+
19
+ def call
20
+ prompt
21
+ check_xdg_configuration
22
+ check_standard_configuration
23
+ copy_configuration
24
+ remove_inheritance
25
+ generate_issues
26
+ apply_changes
27
+ end
28
+
29
+ private
30
+
31
+ attr_reader :root, :paths
32
+
33
+ def prompt
34
+ puts "Update RuboCop configuration with outstanding issues (y/n)?"
35
+
36
+ return if gets.chomp == "y"
37
+
38
+ puts "RuboCop configuration update canceled."
39
+ exit
40
+ end
41
+
42
+ def check_xdg_configuration
43
+ return if full_path(:xdg_config).exist?
44
+
45
+ abort "RuboCop XDG configuration must exist before proceeding."
46
+ end
47
+
48
+ def check_standard_configuration
49
+ return unless full_path(:config).exist?
50
+
51
+ abort "RuboCop configuration exists. Please use a XDG configuration instead."
52
+ end
53
+
54
+ def copy_configuration = full_path(:config).write full_path(:xdg_config).read
55
+
56
+ def generate_issues = system "bundle exec rubocop --auto-gen-config"
57
+
58
+ def remove_inheritance
59
+ full_path(:config).then do |path|
60
+ content = path.read.sub(/inherit_from:\s(issues|\.rubocop_todo.).yml/, "")
61
+ path.write content
62
+ end
63
+ end
64
+
65
+ def apply_changes
66
+ config_path = full_path :config
67
+ todo_path = full_path :todo
68
+
69
+ if todo_path.empty?
70
+ puts "No changes were detected."
71
+ else
72
+ full_path(:xdg_issues).write todo_path.read
73
+ end
74
+
75
+ config_path.delete
76
+ todo_path.delete
77
+ end
78
+
79
+ def full_path(key) = root.join(paths.fetch(key))
80
+ end
81
+
82
+ Updater.new.call
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caliber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.51.0
4
+ version: 0.53.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-03-02 00:00:00.000000000 Z
38
+ date: 2024-04-04 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rubocop
@@ -85,14 +85,14 @@ dependencies:
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.20'
88
+ version: '1.21'
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '1.20'
95
+ version: '1.21'
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: rubocop-rake
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -113,14 +113,14 @@ dependencies:
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '2.27'
116
+ version: '2.28'
117
117
  type: :runtime
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '2.27'
123
+ version: '2.28'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: rubocop-thread_safety
126
126
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +138,8 @@ dependencies:
138
138
  description:
139
139
  email:
140
140
  - brooke@alchemists.io
141
- executables: []
141
+ executables:
142
+ - caliber
142
143
  extensions: []
143
144
  extra_rdoc_files:
144
145
  - README.adoc
@@ -157,6 +158,7 @@ files:
157
158
  - config/rspec.yml
158
159
  - config/ruby.yml
159
160
  - config/thread.yml
161
+ - exe/caliber
160
162
  - lib/caliber.rb
161
163
  homepage: https://alchemists.io/projects/caliber
162
164
  licenses:
@@ -184,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
186
  - !ruby/object:Gem::Version
185
187
  version: '0'
186
188
  requirements: []
187
- rubygems_version: 3.5.6
189
+ rubygems_version: 3.5.7
188
190
  signing_key:
189
191
  specification_version: 4
190
192
  summary: A global, high quality, and constantly updated RuboCop configuration.
metadata.gz.sig CHANGED
Binary file