solargraph 0.56.2 → 0.57.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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/linting.yml +125 -0
  3. data/.github/workflows/plugins.yml +148 -6
  4. data/.github/workflows/rspec.yml +39 -4
  5. data/.github/workflows/typecheck.yml +5 -2
  6. data/.gitignore +5 -0
  7. data/.overcommit.yml +72 -0
  8. data/.rspec +1 -0
  9. data/.rubocop.yml +66 -0
  10. data/.rubocop_todo.yml +2627 -0
  11. data/.yardopts +1 -0
  12. data/CHANGELOG.md +42 -0
  13. data/README.md +8 -4
  14. data/Rakefile +125 -13
  15. data/lib/solargraph/api_map/cache.rb +3 -2
  16. data/lib/solargraph/api_map/constants.rb +218 -0
  17. data/lib/solargraph/api_map/index.rb +20 -26
  18. data/lib/solargraph/api_map/source_to_yard.rb +10 -4
  19. data/lib/solargraph/api_map/store.rb +126 -18
  20. data/lib/solargraph/api_map.rb +212 -234
  21. data/lib/solargraph/bench.rb +1 -0
  22. data/lib/solargraph/complex_type/type_methods.rb +1 -0
  23. data/lib/solargraph/complex_type/unique_type.rb +7 -7
  24. data/lib/solargraph/complex_type.rb +5 -1
  25. data/lib/solargraph/convention/active_support_concern.rb +111 -0
  26. data/lib/solargraph/convention/base.rb +17 -0
  27. data/lib/solargraph/convention/data_definition/data_assignment_node.rb +1 -0
  28. data/lib/solargraph/convention/data_definition/data_definition_node.rb +3 -1
  29. data/lib/solargraph/convention/data_definition.rb +2 -1
  30. data/lib/solargraph/convention/gemspec.rb +1 -1
  31. data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +1 -0
  32. data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +3 -1
  33. data/lib/solargraph/convention/struct_definition.rb +36 -13
  34. data/lib/solargraph/convention.rb +31 -2
  35. data/lib/solargraph/diagnostics/rubocop.rb +6 -1
  36. data/lib/solargraph/diagnostics/rubocop_helpers.rb +1 -1
  37. data/lib/solargraph/doc_map.rb +40 -12
  38. data/lib/solargraph/environ.rb +9 -2
  39. data/lib/solargraph/gem_pins.rb +17 -11
  40. data/lib/solargraph/language_server/host/dispatch.rb +2 -0
  41. data/lib/solargraph/language_server/host/message_worker.rb +3 -0
  42. data/lib/solargraph/language_server/host.rb +2 -1
  43. data/lib/solargraph/language_server/message/base.rb +2 -1
  44. data/lib/solargraph/language_server/message/extended/check_gem_version.rb +1 -1
  45. data/lib/solargraph/language_server/message/text_document/definition.rb +2 -0
  46. data/lib/solargraph/language_server/message/text_document/formatting.rb +16 -2
  47. data/lib/solargraph/language_server/message/text_document/type_definition.rb +1 -0
  48. data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +2 -0
  49. data/lib/solargraph/language_server/progress.rb +8 -0
  50. data/lib/solargraph/language_server/request.rb +1 -0
  51. data/lib/solargraph/library.rb +8 -15
  52. data/lib/solargraph/location.rb +2 -0
  53. data/lib/solargraph/logging.rb +11 -2
  54. data/lib/solargraph/page.rb +4 -0
  55. data/lib/solargraph/parser/comment_ripper.rb +8 -1
  56. data/lib/solargraph/parser/flow_sensitive_typing.rb +32 -4
  57. data/lib/solargraph/parser/node_methods.rb +2 -2
  58. data/lib/solargraph/parser/node_processor/base.rb +1 -1
  59. data/lib/solargraph/parser/node_processor.rb +6 -2
  60. data/lib/solargraph/parser/parser_gem/class_methods.rb +1 -1
  61. data/lib/solargraph/parser/parser_gem/flawed_builder.rb +1 -0
  62. data/lib/solargraph/parser/parser_gem/node_chainer.rb +3 -1
  63. data/lib/solargraph/parser/parser_gem/node_methods.rb +4 -2
  64. data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +3 -2
  65. data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +2 -0
  66. data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +3 -0
  67. data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +35 -14
  68. data/lib/solargraph/parser/region.rb +3 -0
  69. data/lib/solargraph/parser/snippet.rb +2 -0
  70. data/lib/solargraph/pin/base.rb +50 -8
  71. data/lib/solargraph/pin/base_variable.rb +1 -2
  72. data/lib/solargraph/pin/callable.rb +9 -0
  73. data/lib/solargraph/pin/closure.rb +2 -0
  74. data/lib/solargraph/pin/common.rb +6 -2
  75. data/lib/solargraph/pin/constant.rb +2 -0
  76. data/lib/solargraph/pin/delegated_method.rb +1 -0
  77. data/lib/solargraph/pin/local_variable.rb +4 -1
  78. data/lib/solargraph/pin/method.rb +8 -5
  79. data/lib/solargraph/pin/method_alias.rb +3 -0
  80. data/lib/solargraph/pin/parameter.rb +18 -8
  81. data/lib/solargraph/pin/proxy_type.rb +1 -0
  82. data/lib/solargraph/pin/reference/override.rb +15 -1
  83. data/lib/solargraph/pin/reference/superclass.rb +5 -0
  84. data/lib/solargraph/pin/reference.rb +26 -0
  85. data/lib/solargraph/pin/search.rb +3 -1
  86. data/lib/solargraph/pin/signature.rb +2 -0
  87. data/lib/solargraph/pin/symbol.rb +5 -0
  88. data/lib/solargraph/pin_cache.rb +64 -4
  89. data/lib/solargraph/position.rb +2 -0
  90. data/lib/solargraph/range.rb +1 -0
  91. data/lib/solargraph/rbs_map/conversions.rb +7 -5
  92. data/lib/solargraph/rbs_map/core_map.rb +3 -0
  93. data/lib/solargraph/rbs_map.rb +15 -2
  94. data/lib/solargraph/shell.rb +3 -0
  95. data/lib/solargraph/source/chain/link.rb +10 -1
  96. data/lib/solargraph/source/chain.rb +9 -2
  97. data/lib/solargraph/source/change.rb +2 -2
  98. data/lib/solargraph/source/cursor.rb +2 -3
  99. data/lib/solargraph/source/source_chainer.rb +1 -1
  100. data/lib/solargraph/source.rb +5 -2
  101. data/lib/solargraph/source_map/clip.rb +1 -1
  102. data/lib/solargraph/source_map/data.rb +4 -0
  103. data/lib/solargraph/source_map/mapper.rb +4 -2
  104. data/lib/solargraph/source_map.rb +21 -14
  105. data/lib/solargraph/type_checker/param_def.rb +2 -0
  106. data/lib/solargraph/type_checker/rules.rb +8 -0
  107. data/lib/solargraph/type_checker.rb +173 -120
  108. data/lib/solargraph/version.rb +1 -1
  109. data/lib/solargraph/workspace/config.rb +0 -2
  110. data/lib/solargraph/workspace/require_paths.rb +98 -0
  111. data/lib/solargraph/workspace.rb +16 -48
  112. data/lib/solargraph/yard_map/mapper/to_method.rb +2 -2
  113. data/lib/solargraph/yardoc.rb +16 -3
  114. data/lib/solargraph.rb +2 -0
  115. data/rbs/fills/tuple.rbs +2 -3
  116. data/sig/shims/parser/3.2.0.1/builders/default.rbs +195 -0
  117. data/sig/shims/thor/1.2.0.1/.rbs_meta.yaml +9 -0
  118. data/sig/shims/thor/1.2.0.1/manifest.yaml +7 -0
  119. data/sig/shims/thor/1.2.0.1/thor.rbs +17 -0
  120. data/solargraph.gemspec +14 -4
  121. metadata +123 -9
  122. data/lib/.rubocop.yml +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82754cd0869fed91a86a2bfb08ca0f54d6468f942620cddd3148bad99724ad88
4
- data.tar.gz: 4e017a78936b0d24eaa6d5db7edcd01ea2b43d6cb365eb5b4892576a141ca2b7
3
+ metadata.gz: 808ec792a7de32df74b885ebf3785cac0b2d09d9c469696e53215423e28f0ede
4
+ data.tar.gz: e01f07f0524fc59c05f4dbc1fe59126000b22ac7870d356291ebb53bf1de10af
5
5
  SHA512:
6
- metadata.gz: 304fb86181925f916d7119da44b85a3753fc33d961da8a61c5525dbcb8d814a87baeeb9767d17b7ec6548c3ffe725bfda6eafbfd7ea75e8bdddf3f1a1a5c103b
7
- data.tar.gz: 73d437e753be70628008f09a7846cba5e16fd47d045017b41c0b301d8a5b34ca04a45127a37c6eada4e61287944ca1af659ecab8df4681bab42a8ecc37d73bc4
6
+ metadata.gz: 450a8f89225f836bc720f0a79ff87a099c3a1ae141b683d60415fc9634a064decfdb187a21e9587043df4c598bb57608103d470b465103914152022d3833b8e9
7
+ data.tar.gz: efa9b1ee5b59c2b42ca9bd3a33b709422720111dac01a9073929c247a390f861997fa507d4fc03567ab3df386eca82c8931cb0c7a59fa6d7be33720d9e5e4188
@@ -0,0 +1,125 @@
1
+ ---
2
+ # To debug locally:
3
+ # npm install -g act
4
+ # act pull_release -j overcommit
5
+
6
+ name: Linting
7
+
8
+ on:
9
+ workflow_dispatch: {}
10
+ pull_request:
11
+ branches: [ master ]
12
+ push:
13
+ branches:
14
+ - 'main'
15
+ tags:
16
+ - 'v*'
17
+
18
+ permissions:
19
+ pull-requests: write
20
+ contents: read
21
+
22
+ jobs:
23
+ overcommit:
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ # Number of commits to fetch. 0 indicates all history for all branches and tags.
28
+ with:
29
+ fetch-depth: 0
30
+
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: 3.4
34
+ bundler: latest
35
+ bundler-cache: true
36
+ cache-version: 2025-06-06
37
+
38
+ - name: Update to best available RBS
39
+ run: |
40
+ bundle update rbs # use latest available for this Ruby version
41
+
42
+ - name: Restore cache of gem annotations
43
+ id: dot-cache-restore
44
+ uses: actions/cache/restore@v4
45
+ with:
46
+ key: |
47
+ 2025-06-26-09-${{ runner.os }}-dot-cache-${{ hashFiles('Gemfile.lock') }}
48
+ restore-keys: |
49
+ 2025-06-26-09-${{ runner.os }}-dot-cache
50
+ 2025-06-26-09-${{ runner.os }}-dot-cache-
51
+ path: |
52
+ /home/runner/.cache/solargraph
53
+
54
+ - name: Install gem types
55
+ run: bundle exec rbs collection install
56
+
57
+ - name: Overcommit
58
+ run: |
59
+ bundle exec overcommit --sign
60
+ SOLARGRAPH_ASSERTS=on bundle exec overcommit --run --diff origin/master
61
+ rubocop:
62
+ name: rubocop
63
+ runs-on: ubuntu-latest
64
+ steps:
65
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66
+ - uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
67
+ with:
68
+ ruby-version: '3.3'
69
+ bundler-cache: true
70
+ - uses: reviewdog/action-rubocop@fcb74ba274da10b18d038d0bcddaae3518739634 # v2.21.2
71
+ with:
72
+ reporter: github-pr-check
73
+ skip_install: true
74
+ use_bundler: true
75
+ rubocop_extensions: 'rubocop-rspec:gemfile rubocop-rake:gemfile rubocop-yard:gemfile'
76
+ rubocop_flags: '-c .rubocop.yml'
77
+ fail_level: info
78
+ rubocop_version: Gemfile
79
+ level: info
80
+ rbs_validate:
81
+ name: rbs validate
82
+ runs-on: ubuntu-latest
83
+
84
+ steps:
85
+ - uses: actions/checkout@v3
86
+ - name: Set up Ruby
87
+ uses: ruby/setup-ruby@v1
88
+ with:
89
+ ruby-version: 3.4
90
+ bundler-cache: false
91
+
92
+ - name: Install gems
93
+ run: bundle install
94
+
95
+ - name: Run rbs validate
96
+ run: bundle exec rbs validate
97
+ rubocop_todo:
98
+ name: .rubocop_todo.yml
99
+ runs-on: ubuntu-latest
100
+
101
+ steps:
102
+ - uses: actions/checkout@v3
103
+ - name: Set up Ruby
104
+ uses: ruby/setup-ruby@v1
105
+ with:
106
+ ruby-version: 3.4
107
+ bundler-cache: false
108
+
109
+ - name: Install gems
110
+ run: bundle install
111
+
112
+ - name: Run RuboCop
113
+ run: bundle exec rubocop -c .rubocop.yml
114
+
115
+ - name: Run RuboCop against todo file
116
+ continue-on-error: true
117
+ run: |
118
+ bundle exec rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp
119
+ if [ -n "$(git status --porcelain)" ]
120
+ then
121
+ git status --porcelain
122
+ git diff -u .
123
+ >&2 echo "Please fix deltas if bad or run 'bundle exec rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp' and push up changes if good"
124
+ exit 1
125
+ fi
@@ -1,16 +1,21 @@
1
- name: Plugin Backwards Compatibility Tests
1
+ ---
2
+ name: Plugin
3
+
4
+ # To debug locally:
5
+ # npm install -g act
6
+ # cd /Users/broz/src/solargraph/ && act pull_request -j run_solargraph_rails_specs # e.g.
2
7
 
3
8
  on:
4
9
  push:
5
- branches: [ master ]
10
+ branches: [master]
6
11
  pull_request:
7
- branches: [ master ]
12
+ branches: [master]
8
13
 
9
14
  permissions:
10
15
  contents: read
11
16
 
12
17
  jobs:
13
- test:
18
+ regression:
14
19
  runs-on: ubuntu-latest
15
20
 
16
21
  steps:
@@ -19,7 +24,7 @@ jobs:
19
24
  uses: ruby/setup-ruby@v1
20
25
  with:
21
26
  ruby-version: '3.0'
22
- bundler-cache: false
27
+ bundler-cache: true
23
28
  - uses: awalsh128/cache-apt-pkgs-action@latest
24
29
  with:
25
30
  packages: yq
@@ -29,14 +34,151 @@ jobs:
29
34
  echo 'gem "solargraph-rails"' > .Gemfile
30
35
  echo 'gem "solargraph-rspec"' >> .Gemfile
31
36
  bundle install
37
+ bundle update rbs
38
+ - name: Configure to use plugins
39
+ run: |
40
+ bundle exec solargraph config
41
+ yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
42
+ yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml
43
+ - name: Install gem types
44
+ run: bundle exec rbs collection update
45
+ - name: Ensure typechecking still works
46
+ run: bundle exec solargraph typecheck --level typed
47
+ - name: Ensure specs still run
48
+ run: bundle exec rake spec
49
+ rails:
50
+ runs-on: ubuntu-latest
51
+
52
+ steps:
53
+ - uses: actions/checkout@v3
54
+ - name: Set up Ruby
55
+ uses: ruby/setup-ruby@v1
56
+ with:
57
+ ruby-version: '3.0'
58
+ bundler-cache: false
59
+ - uses: awalsh128/cache-apt-pkgs-action@latest
60
+ with:
61
+ packages: yq
62
+ version: 1.0
63
+ - name: Install gems
64
+ run: |
65
+ echo 'gem "solargraph-rails"' > .Gemfile
66
+ bundle install
67
+ bundle update rbs
32
68
  - name: Configure to use plugins
33
69
  run: |
34
70
  bundle exec solargraph config
35
71
  yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml
72
+ - name: Install gem types
73
+ run: bundle exec rbs collection update
74
+ - name: Ensure typechecking still works
75
+ run: bundle exec solargraph typecheck --level typed
76
+ - name: Ensure specs still run
77
+ run: bundle exec rake spec
78
+ rspec:
79
+ runs-on: ubuntu-latest
80
+
81
+ steps:
82
+ - uses: actions/checkout@v3
83
+ - name: Set up Ruby
84
+ uses: ruby/setup-ruby@v1
85
+ with:
86
+ ruby-version: '3.0'
87
+ bundler-cache: false
88
+ - uses: awalsh128/cache-apt-pkgs-action@latest
89
+ with:
90
+ packages: yq
91
+ version: 1.0
92
+ - name: Install gems
93
+ run: |
94
+ echo 'gem "solargraph-rspec"' >> .Gemfile
95
+ bundle install
96
+ bundle update rbs
97
+ - name: Configure to use plugins
98
+ run: |
99
+ bundle exec solargraph config
36
100
  yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml
37
101
  - name: Install gem types
38
- run: bundle exec rbs collection install
102
+ run: bundle exec rbs collection update
39
103
  - name: Ensure typechecking still works
40
104
  run: bundle exec solargraph typecheck --level typed
41
105
  - name: Ensure specs still run
42
106
  run: bundle exec rake spec
107
+
108
+ # run_solargraph_rspec_specs:
109
+ # # check out solargraph-rspec as well as this project, and point the former to use the latter as a local gem
110
+ # runs-on: ubuntu-latest
111
+ # steps:
112
+ # - uses: actions/checkout@v3
113
+ # - name: clone https://github.com/lekemula/solargraph-rspec/
114
+ # run: |
115
+ # cd ..
116
+ # git clone https://github.com/lekemula/solargraph-rspec.git
117
+ # cd solargraph-rspec
118
+ # - name: Set up Ruby
119
+ # uses: ruby/setup-ruby@v1
120
+ # with:
121
+ # ruby-version: '3.0'
122
+ # bundler-cache: false
123
+ # - name: Install gems
124
+ # run: |
125
+ # cd ../solargraph-rspec
126
+ # echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
127
+ # bundle install
128
+ # - name: Run specs
129
+ # run: |
130
+ # cd ../solargraph-rspec
131
+ # bundle exec rake spec
132
+
133
+ run_solargraph_rails_specs:
134
+ # check out solargraph-rails as well as this project, and point the former to use the latter as a local gem
135
+ runs-on: ubuntu-latest
136
+ steps:
137
+ - uses: actions/checkout@v3
138
+ - name: clone solargraph-rails
139
+ run: |
140
+ cd ..
141
+ git clone https://github.com/iftheshoefritz/solargraph-rails.git
142
+ cd solargraph-rails
143
+ - name: Set up Ruby
144
+ uses: ruby/setup-ruby@v1
145
+ with:
146
+ # solargraph-rails supports Ruby 3.0+
147
+ ruby-version: '3.0'
148
+ bundler-cache: false
149
+ bundler: latest
150
+ env:
151
+ MATRIX_RAILS_VERSION: "7.0"
152
+ - name: Install gems
153
+ run: |
154
+ set -x
155
+ BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle"
156
+ export BUNDLE_PATH
157
+ cd ../solargraph-rails
158
+ echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile
159
+ bundle install
160
+ bundle update rbs
161
+ RAILS_DIR="$(pwd)/spec/rails7"
162
+ export RAILS_DIR
163
+ cd ${RAILS_DIR}
164
+ bundle install
165
+ bundle exec --gemfile ../../Gemfile rbs --version
166
+ bundle exec --gemfile ../../Gemfile rbs collection install
167
+ cd ../../
168
+ # bundle exec rbs collection init
169
+ # bundle exec rbs collection install
170
+ env:
171
+ MATRIX_RAILS_VERSION: "7.0"
172
+ MATRIX_RAILS_MAJOR_VERSION: '7'
173
+ - name: Run specs
174
+ run: |
175
+ BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle"
176
+ export BUNDLE_PATH
177
+ cd ../solargraph-rails
178
+ bundle exec solargraph --version
179
+ bundle info solargraph
180
+ bundle info rbs
181
+ bundle info yard
182
+ ALLOW_IMPROVEMENTS=true bundle exec rake spec
183
+ env:
184
+ MATRIX_RAILS_VERSION: "7.0"
@@ -17,13 +17,18 @@ permissions:
17
17
  contents: read
18
18
 
19
19
  jobs:
20
- test:
21
-
20
+ rspec:
22
21
  runs-on: ubuntu-latest
23
22
  strategy:
24
23
  matrix:
25
24
  ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', 'head']
26
-
25
+ rbs-version: ['3.6.1', '3.9.4', '4.0.0.dev.4']
26
+ # Ruby 3.0 doesn't work with RBS 3.9.4 or 4.0.0.dev.4
27
+ exclude:
28
+ - ruby-version: '3.0'
29
+ rbs-version: '3.9.4'
30
+ - ruby-version: '3.0'
31
+ rbs-version: '4.0.0.dev.4'
27
32
  steps:
28
33
  - uses: actions/checkout@v3
29
34
  - name: Set up Ruby
@@ -31,7 +36,37 @@ jobs:
31
36
  with:
32
37
  ruby-version: ${{ matrix.ruby-version }}
33
38
  bundler-cache: false
39
+ - name: Set rbs version
40
+ run: echo "gem 'rbs', '${{ matrix.rbs-version }}'" >> .Gemfile
41
+ # /home/runner/.rubies/ruby-head/lib/ruby/gems/3.5.0+2/gems/rbs-3.9.4/lib/rbs.rb:11:
42
+ # warning: tsort was loaded from the standard library,
43
+ # but will no longer be part of the default gems
44
+ # starting from Ruby 3.6.0
45
+ - name: Work around legacy rbs deprecation on ruby > 3.4
46
+ run: echo "gem 'tsort'" >> .Gemfile
47
+ - name: Install gems
48
+ run: |
49
+ bundle install
50
+ bundle update rbs # use latest available for this Ruby version
51
+ - name: Run tests
52
+ run: bundle exec rake spec
53
+ undercover:
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - uses: actions/checkout@v3
57
+ with:
58
+ # fetch all history for all branches and tags so we can
59
+ # compare against origin/master
60
+ fetch-depth: 0
61
+ - name: Set up Ruby
62
+ uses: ruby/setup-ruby@v1
63
+ with:
64
+ ruby-version: '3.4'
65
+ bundler-cache: false
34
66
  - name: Install gems
35
67
  run: bundle install
36
68
  - name: Run tests
37
- run: bundle exec rspec
69
+ run: bundle exec rake spec
70
+ - name: Check PR coverage
71
+ run: bundle exec rake undercover
72
+ continue-on-error: true
@@ -17,7 +17,8 @@ permissions:
17
17
  contents: read
18
18
 
19
19
  jobs:
20
- test:
20
+ solargraph_typed:
21
+ name: Solargraph / typed
21
22
 
22
23
  runs-on: ubuntu-latest
23
24
 
@@ -29,7 +30,9 @@ jobs:
29
30
  ruby-version: 3.4
30
31
  bundler-cache: false
31
32
  - name: Install gems
32
- run: bundle install
33
+ run: |
34
+ bundle install
35
+ bundle update rbs # use latest available for this Ruby version
33
36
  - name: Install gem types
34
37
  run: bundle exec rbs collection install
35
38
  - name: Typecheck self
data/.gitignore CHANGED
@@ -9,3 +9,8 @@
9
9
  doc
10
10
  coverage
11
11
  /tmp/
12
+ /rspec-examples.txt
13
+ /.ruby-version
14
+ /Makefile
15
+ /.pryrc
16
+ /.rspec-local
data/.overcommit.yml ADDED
@@ -0,0 +1,72 @@
1
+ ---
2
+ # Use this file to configure the Overcommit hooks you wish to use. This will
3
+ # extend the default configuration defined in:
4
+ # https://github.com/sds/overcommit/blob/master/config/default.yml
5
+ #
6
+ # At the topmost level of this YAML file is a key representing type of hook
7
+ # being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
8
+ # customize each hook, such as whether to only run it on certain files (via
9
+ # `include`), whether to only display output if it fails (via `quiet`), etc.
10
+ #
11
+ # For a complete list of hooks, see:
12
+ # https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
13
+ #
14
+ # For a complete list of options that you can use to customize hooks, see:
15
+ # https://github.com/sds/overcommit#configuration
16
+ #
17
+ # Uncomment the following lines to make the configuration take effect.
18
+
19
+ PreCommit:
20
+ RuboCop:
21
+ enabled: true
22
+
23
+ Solargraph:
24
+ enabled: true
25
+ exclude:
26
+ - 'spec/**/*'
27
+
28
+ FixMe:
29
+ enabled: true
30
+ exclude:
31
+ # don't freak out over line below
32
+ - '.overcommit.yml'
33
+ # from upstream
34
+ - 'rbs/fills/rubygems/0/basic_specification.rbs'
35
+ keywords: ['FIXME', 'TODO', 'XXX']
36
+
37
+ # creates false positives in CI
38
+ AuthorName:
39
+ enabled: false
40
+
41
+ # creates false positives in CI
42
+ AuthorEmail:
43
+ enabled: false
44
+
45
+ ALL:
46
+ # if you change the next line to 'report', and you make changes to
47
+ # a file, overcommit will have you make the entire file pass
48
+ #
49
+ problem_on_unmodified_line: warn
50
+ # on_warn: fail
51
+ exclude:
52
+ - lib/solargraph/rails/annotations/**/*
53
+ - vendor/**/*
54
+ - ".bundle/**/*"
55
+ - 'core.*'
56
+
57
+ verify_signatures: false
58
+
59
+ #
60
+ # TrailingWhitespace:
61
+ # enabled: true
62
+ # exclude:
63
+ # - '**/db/structure.sql' # Ignore trailing whitespace in generated files
64
+ #
65
+ #PostCheckout:
66
+ # ALL: # Special hook name that customizes all hooks of this type
67
+ # quiet: true # Change all post-checkout hooks to only display output on failure
68
+ #
69
+ # IndexTags:
70
+ # enabled: true # Generate a tags file with `ctags` each time HEAD changes
71
+
72
+ gemfile: Gemfile
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --color
2
2
  --require spec_helper
3
+ --profile
data/.rubocop.yml ADDED
@@ -0,0 +1,66 @@
1
+ ---
2
+ inherit_from: .rubocop_todo.yml
3
+
4
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
5
+ # configuration file. It makes it possible to enable/disable
6
+ # certain cops (checks) and to alter their behavior if they accept
7
+ # any parameters. The file can be placed either in your home
8
+ # directory or in some project directory.
9
+ #
10
+ # RuboCop will start looking for the configuration file in the directory
11
+ # where the inspected file is and continue its way up to the root directory.
12
+ #
13
+ # See https://docs.rubocop.org/rubocop/configuration
14
+ AllCops:
15
+ NewCops: enable
16
+ Exclude:
17
+ - "spec/fixtures/invalid_byte.rb"
18
+ - "spec/fixtures/invalid_node_comment.rb"
19
+ - "spec/fixtures/invalid_utf8.rb"
20
+ - "vendor/**/*"
21
+ - "vendor/**/.*"
22
+ TargetRubyVersion: 3.0
23
+
24
+ RSpec/SpecFilePathFormat:
25
+ Enabled: false
26
+
27
+ Style/MethodDefParentheses:
28
+ EnforcedStyle: require_no_parentheses
29
+
30
+ Layout/EmptyLineAfterGuardClause:
31
+ Enabled: false
32
+
33
+ Lint/UnusedMethodArgument:
34
+ AllowUnusedKeywordArguments: true
35
+
36
+ Metrics/ParameterLists:
37
+ Max: 7
38
+ CountKeywordArgs: false
39
+
40
+
41
+ # we tend to use @@ and the risk doesn't seem high
42
+ Style/ClassVars:
43
+ Enabled: false
44
+
45
+ #
46
+ # Set a relaxed standard on harder-to-address item for ease of
47
+ # contribution - if you are good at refactoring, we welcome PRs to
48
+ # improve existing code!
49
+ #
50
+ Metrics/AbcSize:
51
+ Max: 65
52
+ Metrics/MethodLength:
53
+ Max: 60
54
+ Metrics/ClassLength:
55
+ Max: 500
56
+ Metrics/CyclomaticComplexity:
57
+ Max: 23
58
+ Metrics/PerceivedComplexity:
59
+ Max: 29
60
+ RSpec/ExampleLength:
61
+ Max: 17
62
+
63
+ plugins:
64
+ - rubocop-rspec
65
+ - rubocop-rake
66
+ - rubocop-yard