solargraph-yard-lint 0.1.0 → 0.2.0
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/.yard-lint.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +25 -11
- data/lib/solargraph/yard_lint/diagnostic.rb +5 -4
- data/lib/solargraph/yard_lint/version.rb +1 -2
- data/solargraph-yard-lint.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c965fc8313e5f8c89d71be9d9e73197259c3c8afac9e1d4eac0d7e8330277a66
|
|
4
|
+
data.tar.gz: 9edd2f651730753d3f08e30db176671c150e5f604915a2f54813a6b9ac5e3676
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55c93db498e6c427a31d31cf912654c084d1539ed1e7833078118c2adbbae20cfe7bce6b53aafc735b0693b137dc7b4bc2f0ecd0d9522856bf905faecb37c9d8
|
|
7
|
+
data.tar.gz: aeb8d3bc85f2956adb53223b206a2acd30d7d9711811be6e2e1e24807fe7580928a215c07cb83a789709d5c9560793c7a7cd45e52c36937f78d1189eacbf7866
|
data/.yard-lint.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# solargraph-yard-lint
|
|
2
2
|
|
|
3
|
+
[](https://github.com/lekemula/solargraph-yard-lint/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
A [Solargraph](https://github.com/castwide/solargraph) plugin that surfaces
|
|
4
6
|
[yard-lint](https://github.com/mensfeld/yard-lint) offenses as LSP diagnostics
|
|
5
7
|
in your editor.
|
|
6
8
|
|
|
9
|
+
## Demo
|
|
10
|
+
|
|
11
|
+
https://github.com/user-attachments/assets/2bcd3a5a-3e3c-4b26-8667-f4f6c2479ef8
|
|
12
|
+
|
|
13
|
+
|
|
7
14
|
## Installation
|
|
8
15
|
|
|
9
16
|
Add to your project's `Gemfile`:
|
|
@@ -21,13 +28,11 @@ Then `bundle install`.
|
|
|
21
28
|
|
|
22
29
|
Add to your project's `.solargraph.yml`:
|
|
23
30
|
|
|
24
|
-
```
|
|
25
|
-
plugins:
|
|
26
|
-
- solargraph-yard-lint
|
|
27
|
-
reporters:
|
|
28
|
-
-
|
|
29
|
-
- require_not_found
|
|
30
|
-
- yard_lint
|
|
31
|
+
```diff
|
|
32
|
+
plugins:
|
|
33
|
+
+ - solargraph-yard-lint
|
|
34
|
+
reporters:
|
|
35
|
+
+ - yard_lint
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
Restart your Solargraph language server. YARD documentation offenses will
|
|
@@ -36,11 +41,20 @@ appear as diagnostics in your editor.
|
|
|
36
41
|
Configure yard-lint itself via `.yard-lint.yml` in your project root — see
|
|
37
42
|
[yard-lint's documentation](https://github.com/mensfeld/yard-lint) for details.
|
|
38
43
|
|
|
39
|
-
##
|
|
44
|
+
## Contributing
|
|
45
|
+
|
|
46
|
+
Bug reports and pull requests are welcome at
|
|
47
|
+
[github.com/lekemula/solargraph-yard-lint](https://github.com/lekemula/solargraph-yard-lint).
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
bundle install
|
|
51
|
+
bundle exec rspec
|
|
52
|
+
bundle exec rubocop
|
|
53
|
+
bundle exec yard-lint lib/
|
|
54
|
+
```
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
edits will not produce yard-lint diagnostics until the file is saved.
|
|
56
|
+
Please run the full check suite locally before opening a PR — CI runs
|
|
57
|
+
the same three commands. New behavior should come with specs.
|
|
44
58
|
|
|
45
59
|
## License
|
|
46
60
|
|
|
@@ -24,7 +24,7 @@ module Solargraph
|
|
|
24
24
|
|
|
25
25
|
require_yard_lint(yard_lint_version)
|
|
26
26
|
result = Solargraph::CHDIR_MUTEX.synchronize do
|
|
27
|
-
::Yard::Lint.run(path: source.filename, progress: false)
|
|
27
|
+
::Yard::Lint.run(path: source.filename, source: source.code, progress: false)
|
|
28
28
|
end
|
|
29
29
|
return [] if result.clean?
|
|
30
30
|
|
|
@@ -37,8 +37,9 @@ module Solargraph
|
|
|
37
37
|
|
|
38
38
|
private
|
|
39
39
|
|
|
40
|
-
# yard-lint
|
|
41
|
-
#
|
|
40
|
+
# yard-lint requires a single .rb path for config resolution and offense
|
|
41
|
+
# location reporting. The buffer text is passed via source:, so the file
|
|
42
|
+
# does not need to exist on disk.
|
|
42
43
|
#
|
|
43
44
|
# @param source [Solargraph::Source]
|
|
44
45
|
# @return [Boolean]
|
|
@@ -46,7 +47,7 @@ module Solargraph
|
|
|
46
47
|
filename = source.filename
|
|
47
48
|
return false if filename.nil? || filename.empty?
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
filename.end_with?('.rb')
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
# @return [String]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solargraph-yard-lint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lekë Mula
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '1.
|
|
32
|
+
version: '1.6'
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - "~>"
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '1.
|
|
39
|
+
version: '1.6'
|
|
40
40
|
description: Adds a yard_lint diagnostic reporter to Solargraph, powered by the yard-lint
|
|
41
41
|
gem. Surfaces YARD documentation issues in your editor.
|
|
42
42
|
email:
|