standard 1.39.1 → 1.39.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +39 -23
- data/lib/standard/lsp/diagnostic.rb +8 -2
- data/lib/standard/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d4af941058eb542737ef5766b38878bf776cc1d2c2f63483259a083289d6ead
|
4
|
+
data.tar.gz: bb2ee384fe411f73b28a82dc71b7076c9fe5d434484d1ee2f86b71244a73724f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3660c9dbacfb529228e9a537993b8a3a7890be024dc8c4c58483d2a49c6068b0b717ee75fc2ff4b854fdd60f3dfd3c20e6591fe7dd2a556c190ad1fadc78ca18
|
7
|
+
data.tar.gz: 5f52474c6dc41df0cf2df552931c73c905cd5316c68081bfc893ac15a2fe4ef6ec7db37e1883ffbff2444b9a668c625b135e0ac5ac5741de90cefceb0978af71
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
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)
|
@@ -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
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.39.
|
4
|
+
version: 1.39.2
|
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-07-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|