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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61f4706a15a10a7daf1a6799bcf2b34a6399d52287055c3764eb6d4d23bbf88d
4
- data.tar.gz: 8ab135ecc1779da62b5bb122c300d8e2c01e967483b563da88b280c6be103a62
3
+ metadata.gz: c965fc8313e5f8c89d71be9d9e73197259c3c8afac9e1d4eac0d7e8330277a66
4
+ data.tar.gz: 9edd2f651730753d3f08e30db176671c150e5f604915a2f54813a6b9ac5e3676
5
5
  SHA512:
6
- metadata.gz: 49a4f3cef512e8dbe65691d122154a46ca068b7226a8b0f27ade5e667cbbe9ca9a18d859acc3f01ed94d177950bb4af1eb81094686b1d78ba4539a53c4548970
7
- data.tar.gz: 431848919af29a62c0931ba4bba1a3d5ec1672dc3e16107731a9f73e3874a8fa197e6d8ac1528879258ada826e5deb6163d7cb72ce12e70a526190a54d8e6db8
6
+ metadata.gz: 55c93db498e6c427a31d31cf912654c084d1539ed1e7833078118c2adbbae20cfe7bce6b53aafc735b0693b137dc7b4bc2f0ecd0d9522856bf905faecb37c9d8
7
+ data.tar.gz: aeb8d3bc85f2956adb53223b206a2acd30d7d9711811be6e2e1e24807fe7580928a215c07cb83a789709d5c9560793c7a7cd45e52c36937f78d1189eacbf7866
data/.yard-lint.yml CHANGED
@@ -15,6 +15,7 @@ AllValidators:
15
15
  - 'node_modules/**/*'
16
16
  - 'spec/**/*'
17
17
  - 'test/**/*'
18
+ - 'lib/**/version.rb'
18
19
 
19
20
  # Exit code behavior (error, warning, convention, never)
20
21
  FailOnSeverity: warning
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0
4
+
5
+ - Pass the editor's buffer contents to yard-lint via the new `source:` keyword
6
+ (yard-lint 1.6+), so diagnostics now reflect unsaved edits. Bumps the
7
+ yard-lint dependency to `~> 1.6`.
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  - Initial release.
data/README.md CHANGED
@@ -1,9 +1,16 @@
1
1
  # solargraph-yard-lint
2
2
 
3
+ [![CI](https://github.com/lekemula/solargraph-yard-lint/actions/workflows/ci.yml/badge.svg)](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
- ```yaml
25
- plugins:
26
- - solargraph-yard-lint
27
- reporters:
28
- - rubocop
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
- ## Notes
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
- yard-lint reads files from disk and does not accept stdin, so this reporter
42
- only lints sources whose buffer contents match the on-disk file. Unsaved
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 reads from disk and cannot accept unsaved buffer contents,
41
- # so only lint when the source is backed by an on-disk file.
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
- File.file?(filename)
50
+ filename.end_with?('.rb')
50
51
  end
51
52
 
52
53
  # @return [String]
@@ -4,7 +4,6 @@
4
4
  module Solargraph
5
5
  # yard-lint diagnostics plugin for Solargraph.
6
6
  module YardLint
7
- # Gem version.
8
- VERSION = '0.1.0'
7
+ VERSION = '0.2.0'
9
8
  end
10
9
  end
@@ -26,5 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.require_paths = ['lib']
27
27
 
28
28
  spec.add_dependency 'solargraph', '>= 0.52.0'
29
- spec.add_dependency 'yard-lint', '~> 1.5'
29
+ spec.add_dependency 'yard-lint', '~> 1.6'
30
30
  end
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.1.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.5'
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.5'
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: