standard 1.28.0 → 1.28.1

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: f90048ed9d5a6f7fb709f72f0ce48e3afca1207f4b75ec7673baaa77b7a15ed8
4
- data.tar.gz: e29c6e2e9c919611bfaf1ec1fb2907c0bb2552eb06a7a4340e45140ec0c0a2ad
3
+ metadata.gz: e8c0920e71bbf9f203f59f683dfaec09f0b5828546a4b47d9d72079aa2a8fda9
4
+ data.tar.gz: 53cce6a924e050971619a48ae411dba9e002f0c3cdd48588c3f7a2ee68e20c9f
5
5
  SHA512:
6
- metadata.gz: 53482d43182ade55a2828dd8fbd877c54dfc88cddf7dfdc842fb6a2ade273930fd43422dac37687f42617bfc35d2c65ac2b11211abad4e4d7f1a5409b5fa6cf3
7
- data.tar.gz: 84a62318f010f8361e94120f579fe24eca5d0ae7efc3cabe7175817f6ce799857ce95abbf59acfe3d898396464cd55231b2d29fd80dbfe781a9a561401e87312
6
+ metadata.gz: f8d4318e2527b6f2d20308caa846ba861a1432a9b1930ebfd2003475eed86dc0b095191cc64f1415a8d6f6130e82923e792cbadfc686eb60401a18026ea8b0df
7
+ data.tar.gz: e1fa000dc59e5c530a369238ddc1beb75470d10deb191709bc9d84546b39a327bb4bd80ee80202ec81fc788fee8cd8af588ccab75a4f111457336a16af3a9e52
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.28.1
4
+
5
+ * Fixes plugin behavior caused by setting `DisabledByDefault: true` in `AllCops`
6
+ Effectively, a single lint_roller plugin whose `rules` were of type `:object`
7
+ would inadvertently mark all previously-defined rules as invalid.
8
+ [#557](https://github.com/standardrb/standard/pull/557)
9
+
3
10
  ## 1.28.0
4
11
 
5
12
  * Refactor Standard into 3 gems and convert all built-in configuration into
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.28.0)
4
+ standard (1.28.1)
5
5
  language_server-protocol (~> 3.17.0.2)
6
6
  lint_roller (~> 1.0)
7
7
  rubocop (~> 1.50.2)
@@ -23,7 +23,7 @@ GEM
23
23
  method_source (1.0.0)
24
24
  minitest (5.18.0)
25
25
  parallel (1.23.0)
26
- parser (3.2.2.0)
26
+ parser (3.2.2.1)
27
27
  ast (~> 2.4.1)
28
28
  rainbow (3.1.1)
29
29
  rake (13.0.6)
data/README.md CHANGED
@@ -15,7 +15,7 @@ supports plugins built with
15
15
 
16
16
  Standard Ruby was created and is maintained by the team at [Test
17
17
  Double](https://testdouble.com), because we appreciate the importance of
18
- balancing predictably consistent code with preserving developers' autonomy. 💚
18
+ balancing predictable, consistent code with preserving developer autonomy. 💚
19
19
 
20
20
  Topics covered in this README:
21
21
 
@@ -37,7 +37,7 @@ ever agree on what all the rules and format should be.**
37
37
 
38
38
  This has resulted in innumerable teams arguing how to configure their linters
39
39
  and formatters over literal decades. Some teams routinely divert time and energy
40
- from whatever they're building to reach concensus on where commas should go.
40
+ from whatever they're building to reach consensus on where commas should go.
41
41
  Other teams have an overzealous tech lead who sets up everything _his favorite
42
42
  way_ and then imposes his will on others. It's not uncommon to witness
43
43
  passive-aggressive programmers change a contentious rule back-and-forth,
@@ -63,9 +63,9 @@ for most of the ways people use Ruby, most of the time.
63
63
 
64
64
  If you adopt Standard Ruby, what's in it for you? Time saved that would've been
65
65
  spent arguing over how to set things up. Also, seamless upgrades: we stay on top
66
- of each new RuboCop rule ship an updated configuration on a monthly release
66
+ of each new RuboCop rule and update our configuration on a monthly release
67
67
  cadence. But the best part of adopting Standard as your linter and formatter?
68
- You'll spend a whole lot less time thinking about linters and formatters.
68
+ **You'll spend a whole lot less time thinking about linters and formatters.**
69
69
 
70
70
  So please, give Standard Ruby a try. If you're like [these
71
71
  folks](#who-uses-standard-ruby), you'll soon realize that the value of a linter
@@ -110,7 +110,7 @@ A majority of Standard's rules can be safely fixed automatically.
110
110
 
111
111
  ```
112
112
  # CLI
113
- $ standard --fix
113
+ $ standardrb --fix
114
114
 
115
115
  # Rake
116
116
  $ rake standard:fix
@@ -60,7 +60,8 @@ module Standard
60
60
  if rules.type == :path
61
61
  [RuboCop::ConfigLoader.load_file(rules.value), rules.value]
62
62
  elsif rules.type == :object
63
- [RuboCop::Config.new(rules.value), nil]
63
+ path = plugin.method(:rules).source_location[0]
64
+ [RuboCop::Config.create(rules.value, path), path]
64
65
  elsif rules.type == :error
65
66
  raise "Plugin `#{plugin.about&.name || plugin.inspect}' failed to load with error: #{rules.value.respond_to?(:message) ? rules.value.message : rules.value}"
66
67
  end
@@ -125,11 +126,22 @@ module Standard
125
126
 
126
127
  def fake_out_rubocop_default_configuration(options_config)
127
128
  og_default_config = RuboCop::ConfigLoader.instance_variable_get(:@default_configuration)
129
+ set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
128
130
  result = yield blank_rubocop_config(options_config)
129
131
  RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, og_default_config)
130
132
  result
131
133
  end
132
134
 
135
+ # Avoid a warning that would otherwise be emitted by any plugin that set TargetRailsVersion
136
+ # because it's not a default AllCops key specified in RuboCop's embedded default config.
137
+ #
138
+ # See: https://github.com/rubocop/rubocop/pull/11833
139
+ def set_target_rails_version_on_all_cops_because_its_technically_not_allowed!(options_config)
140
+ return unless options_config.key?("AllCops")
141
+
142
+ options_config["AllCops"]["TargetRailsVersion"] = "~"
143
+ end
144
+
133
145
  def blank_rubocop_config(example_config)
134
146
  RuboCop::Config.new(example_config.to_h.slice(*MANDATORY_RUBOCOP_CONFIG_KEYS), "")
135
147
  end
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.28.0")
2
+ VERSION = Gem::Version.new("1.28.1")
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.0
4
+ version: 1.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-22 00:00:00.000000000 Z
11
+ date: 2023-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop