standard 1.39.1 → 1.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +12 -8
- data/README.md +39 -23
- data/config/base.yml +3 -0
- data/lib/standard/lsp/diagnostic.rb +8 -2
- data/lib/standard/version.rb +1 -1
- data/standard.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11a5e687261fb830d043558db4065c4533725a5997b1b70b3ba2b7656410fc2b
|
4
|
+
data.tar.gz: 1a38f3258931be3002752d726bcae77caf6e6dedb92b7e758cf65052b6db0464
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 399225a5d25d05fbef38bc7008801a680c48fc89c139820010ddd0ceffdc39008a1ec405dfe0ad414a43032d1c2227a0fb487618ce0f67bffe28cffa3afe35f5
|
7
|
+
data.tar.gz: feedd6180c2d564c3e0126e7f6f83731f8b029421030b7263f810e531b26943d5deec44247a8a6b136d3881b38c853762838e79742899ce091b1bf787201d893
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 1.40.0
|
6
|
+
|
7
|
+
* Updates rubocop to [1.65.1](https://github.com/rubocop/rubocop/releases/tag/v1.65.1)
|
8
|
+
|
9
|
+
## 1.39.2
|
10
|
+
|
11
|
+
* Ensure a URI scheme on file paths from the built-in LSP [#642](https://github.com/standardrb/standard/pull/642).
|
12
|
+
|
5
13
|
## 1.39.1
|
6
14
|
|
7
15
|
* Fix LSP when `format` is set [#638](https://github.com/standardrb/standard/issues/638)
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standard (1.
|
4
|
+
standard (1.40.0)
|
5
5
|
language_server-protocol (~> 3.17.0.2)
|
6
6
|
lint_roller (~> 1.0)
|
7
|
-
rubocop (~> 1.
|
7
|
+
rubocop (~> 1.65.0)
|
8
8
|
standard-custom (~> 1.0.0)
|
9
9
|
standard-performance (~> 1.4)
|
10
10
|
|
@@ -16,6 +16,7 @@ GEM
|
|
16
16
|
json (2.6.3)
|
17
17
|
language_server-protocol (3.17.0.3)
|
18
18
|
lint_roller (1.1.0)
|
19
|
+
logger (1.6.0)
|
19
20
|
m (1.6.2)
|
20
21
|
method_source (>= 0.6.7)
|
21
22
|
rake (>= 0.9.2.2)
|
@@ -26,19 +27,21 @@ GEM
|
|
26
27
|
parser (3.3.0.5)
|
27
28
|
ast (~> 2.4.1)
|
28
29
|
racc
|
29
|
-
prism (0.
|
30
|
+
prism (0.30.0)
|
30
31
|
racc (1.7.1)
|
31
32
|
rainbow (3.1.1)
|
32
33
|
rake (13.0.6)
|
34
|
+
rbs (3.5.2)
|
35
|
+
logger
|
33
36
|
regexp_parser (2.8.2)
|
34
37
|
rexml (3.2.6)
|
35
|
-
rubocop (1.
|
38
|
+
rubocop (1.65.1)
|
36
39
|
json (~> 2.3)
|
37
40
|
language_server-protocol (>= 3.17.0)
|
38
41
|
parallel (~> 1.10)
|
39
42
|
parser (>= 3.3.0.2)
|
40
43
|
rainbow (>= 2.2.2, < 4.0)
|
41
|
-
regexp_parser (>=
|
44
|
+
regexp_parser (>= 2.4, < 3.0)
|
42
45
|
rexml (>= 3.2.5, < 4.0)
|
43
46
|
rubocop-ast (>= 1.31.1, < 2.0)
|
44
47
|
ruby-progressbar (~> 1.7)
|
@@ -48,9 +51,10 @@ GEM
|
|
48
51
|
rubocop-performance (1.21.0)
|
49
52
|
rubocop (>= 1.48.1, < 2.0)
|
50
53
|
rubocop-ast (>= 1.31.1, < 2.0)
|
51
|
-
ruby-lsp (0.
|
54
|
+
ruby-lsp (0.17.7)
|
52
55
|
language_server-protocol (~> 3.17.0)
|
53
|
-
prism (>= 0.
|
56
|
+
prism (>= 0.29.0, < 0.31)
|
57
|
+
rbs (>= 3, < 4)
|
54
58
|
sorbet-runtime (>= 0.5.10782)
|
55
59
|
ruby-progressbar (1.13.0)
|
56
60
|
simplecov (0.22.0)
|
@@ -59,7 +63,7 @@ GEM
|
|
59
63
|
simplecov_json_formatter (~> 0.1)
|
60
64
|
simplecov-html (0.12.3)
|
61
65
|
simplecov_json_formatter (0.1.4)
|
62
|
-
sorbet-runtime (0.5.
|
66
|
+
sorbet-runtime (0.5.11481)
|
63
67
|
standard-custom (1.0.2)
|
64
68
|
lint_roller (~> 1.0)
|
65
69
|
rubocop (~> 1.50)
|
data/README.md
CHANGED
@@ -11,7 +11,8 @@ configuration** to all of RuboCop's built-in rules as well as those included in
|
|
11
11
|
[rubocop-performance](https://github.com/rubocop/rubocop-performance). It also
|
12
12
|
supports plugins built with
|
13
13
|
[lint_roller](https://github.com/standardrb/lint_roller), like
|
14
|
-
[standard-rails](https://github.com/standardrb/standard-rails)
|
14
|
+
[standard-rails](https://github.com/standardrb/standard-rails) and
|
15
|
+
[standard-sorbet](https://github.com/standardrb/standard-sorbet).
|
15
16
|
|
16
17
|
Standard Ruby was created and is maintained by the team at [Test
|
17
18
|
Double](https://testdouble.com), because we appreciate the importance of
|
@@ -35,7 +36,7 @@ good idea. People also agree it's easier to work in codebases that exhibit a
|
|
35
36
|
consistent style and format. So, what's the problem? **No two developers will
|
36
37
|
ever agree on what all the rules and format should be.**
|
37
38
|
|
38
|
-
This has resulted in innumerable teams arguing how to configure their linters
|
39
|
+
This has resulted in innumerable teams arguing about how to configure their linters
|
39
40
|
and formatters over literal decades. Some teams routinely divert time and energy
|
40
41
|
from whatever they're building to reach consensus on where commas should go.
|
41
42
|
Other teams have an overzealous tech lead who sets up everything _his favorite
|
@@ -76,17 +77,18 @@ is in using one at all and not in the particulars of how it's configured.
|
|
76
77
|
### Install
|
77
78
|
|
78
79
|
Getting started is as easy as `gem install standard` or throwing it in your
|
79
|
-
project's Gemfile
|
80
|
+
project's Gemfile and running `bundle install`:
|
80
81
|
|
81
82
|
```ruby
|
82
|
-
gem "standard"
|
83
|
+
gem "standard"
|
83
84
|
```
|
84
85
|
|
85
|
-
### Running Standard
|
86
|
+
### Running Standard Ruby
|
86
87
|
|
87
|
-
Once installed, you can
|
88
|
+
Once installed, you can run Standard from the command line via its built-in
|
89
|
+
executable or as a Rake task.
|
88
90
|
|
89
|
-
|
91
|
+
Standard Ruby's binary is named `standardrb` to distinguish it from
|
90
92
|
[StandardJS](https://github.com/standard/standard):
|
91
93
|
|
92
94
|
```
|
@@ -137,8 +139,8 @@ $ rake standard:fix_unsafely
|
|
137
139
|
|
138
140
|
So long as your code is checked into source control, there's no mortal harm in
|
139
141
|
running with unsafe fixes enabled. If the changes look good to you and your
|
140
|
-
tests pass, then it's probably
|
141
|
-
by hand.
|
142
|
+
tests pass, then it's probably no more error prone than manually editing
|
143
|
+
every change by hand.
|
142
144
|
|
143
145
|
## Integrating Standard into your workflow
|
144
146
|
|
@@ -151,7 +153,7 @@ continuous integration systems.
|
|
151
153
|
|
152
154
|
We've added a number of editing guides for getting started:
|
153
155
|
|
154
|
-
- [VS Code](https://github.com/standardrb/vscode
|
156
|
+
- [VS Code](https://github.com/standardrb/standard/wiki/IDE:-vscode)
|
155
157
|
- [vim](https://github.com/standardrb/standard/wiki/IDE:-vim)
|
156
158
|
- [neovim](https://github.com/standardrb/standard/wiki/IDE:-neovim)
|
157
159
|
- [RubyMine](https://www.jetbrains.com/help/ruby/rubocop.html#disable_rubocop)
|
@@ -165,19 +167,32 @@ added!
|
|
165
167
|
|
166
168
|
#### Language Server Protocol support
|
167
169
|
|
168
|
-
If you don't see your preferred editor above, Standard Ruby also
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
170
|
+
If you don't see your preferred editor above, Standard Ruby also offers robust
|
171
|
+
[language server](https://microsoft.github.io/language-server-protocol/) support,
|
172
|
+
in two ways, both included with the `standard` gem:
|
173
|
+
|
174
|
+
1. A [Ruby LSP](https://github.com/Shopify/ruby-lsp) add-on, which (if
|
175
|
+
the `standard` gem is in your `Gemfile`) will be loaded automatically
|
176
|
+
2. A language server executable, which can be run from the command line
|
177
|
+
with `standardrb --lsp`
|
178
|
+
|
179
|
+
| Capability | Ruby LSP Add-on | Internal Server |
|
180
|
+
| ------------- | ------------- | ------------- |
|
181
|
+
| Diagnostics (Linting) | ✅ ([Pull](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics)) | ✅ ([Push](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_publishDiagnostics)) |
|
182
|
+
| [Formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_formatting) | ✅ | ✅ |
|
183
|
+
| [Code Actions](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction) | ✅ | ❌ |
|
184
|
+
| Everything else | ❌ | ❌ |
|
185
|
+
|
186
|
+
Due to the advantages of Pull diagnostics and its inclusion of Code Actions
|
187
|
+
("Quick Fixes" in VS Code parlance), we recommend using Standard's [Ruby LSP
|
188
|
+
add-on](https://github.com/standardrb/standard/wiki/IDE:-vscode#using-ruby-lsp)
|
189
|
+
where possible.
|
190
|
+
|
191
|
+
Regardless of which language server you use, many editors have added LSP
|
192
|
+
support, with each bringing their own approach to configuration. Many LSP
|
193
|
+
features should "just work", but when in doubt, please consult our [editor
|
194
|
+
guides above](#editor-support) as well as your editor's own documentation on how
|
195
|
+
to configure LSP formatters and linters.
|
181
196
|
|
182
197
|
### CI support
|
183
198
|
|
@@ -477,6 +492,7 @@ Here are a few examples of Ruby Standard-compliant teams & projects:
|
|
477
492
|
* [Brave Software](https://github.com/brave-intl/publishers)
|
478
493
|
* [Collective Idea](https://collectiveidea.com/)
|
479
494
|
* [Culture Foundry](https://www.culturefoundry.com/)
|
495
|
+
* [Datadog](https://www.datadoghq.com/)
|
480
496
|
* [Donut](https://www.donut.com/)
|
481
497
|
* [Elevate Labs](https://elevatelabs.com)
|
482
498
|
* [Envoy](https://www.envoy.com)
|
data/config/base.yml
CHANGED
@@ -82,7 +82,7 @@ module Standard
|
|
82
82
|
document_changes: [
|
83
83
|
Interface::TextDocumentEdit.new(
|
84
84
|
text_document: Interface::OptionalVersionedTextDocumentIdentifier.new(
|
85
|
-
uri: @uri.to_s,
|
85
|
+
uri: ensure_uri_scheme(@uri.to_s).to_s,
|
86
86
|
version: nil
|
87
87
|
),
|
88
88
|
edits: correctable? ? offense_replacements : []
|
@@ -113,7 +113,7 @@ module Standard
|
|
113
113
|
document_changes: [
|
114
114
|
Interface::TextDocumentEdit.new(
|
115
115
|
text_document: Interface::OptionalVersionedTextDocumentIdentifier.new(
|
116
|
-
uri: @uri.to_s,
|
116
|
+
uri: ensure_uri_scheme(@uri.to_s).to_s,
|
117
117
|
version: nil
|
118
118
|
),
|
119
119
|
edits: line_disable_comment
|
@@ -163,6 +163,12 @@ module Standard
|
|
163
163
|
def correctable?
|
164
164
|
!@offense.corrector.nil?
|
165
165
|
end
|
166
|
+
|
167
|
+
def ensure_uri_scheme(uri)
|
168
|
+
uri = URI.parse(uri)
|
169
|
+
uri.scheme = "file" if uri.scheme.nil?
|
170
|
+
uri
|
171
|
+
end
|
166
172
|
end
|
167
173
|
end
|
168
174
|
end
|
data/lib/standard/version.rb
CHANGED
data/standard.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
spec.metadata["rubygems_mfa_required"] = "true"
|
25
25
|
|
26
|
-
spec.add_dependency "rubocop", "~> 1.
|
26
|
+
spec.add_dependency "rubocop", "~> 1.65.0"
|
27
27
|
|
28
28
|
spec.add_dependency "lint_roller", "~> 1.0"
|
29
29
|
spec.add_dependency "standard-custom", "~> 1.0.0"
|
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.
|
4
|
+
version: 1.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Searls
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.65.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.65.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: lint_roller
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
- !ruby/object:Gem::Version
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
|
-
rubygems_version: 3.
|
191
|
+
rubygems_version: 3.4.10
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Ruby Style Guide, with linter & automatic code fixer
|