docscribe 1.0.0 → 1.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/README.md +692 -180
- data/exe/docscribe +2 -74
- data/lib/docscribe/cli/config_builder.rb +62 -0
- data/lib/docscribe/cli/init.rb +58 -0
- data/lib/docscribe/cli/options.rb +204 -0
- data/lib/docscribe/cli/run.rb +415 -0
- data/lib/docscribe/cli.rb +31 -0
- data/lib/docscribe/config/defaults.rb +71 -0
- data/lib/docscribe/config/emit.rb +126 -0
- data/lib/docscribe/config/filtering.rb +160 -0
- data/lib/docscribe/config/loader.rb +59 -0
- data/lib/docscribe/config/rbs.rb +51 -0
- data/lib/docscribe/config/sorbet.rb +87 -0
- data/lib/docscribe/config/sorting.rb +23 -0
- data/lib/docscribe/config/template.rb +176 -0
- data/lib/docscribe/config/utils.rb +102 -0
- data/lib/docscribe/config.rb +20 -230
- data/lib/docscribe/infer/ast_walk.rb +28 -0
- data/lib/docscribe/infer/constants.rb +11 -0
- data/lib/docscribe/infer/literals.rb +55 -0
- data/lib/docscribe/infer/names.rb +43 -0
- data/lib/docscribe/infer/params.rb +62 -0
- data/lib/docscribe/infer/raises.rb +68 -0
- data/lib/docscribe/infer/returns.rb +171 -0
- data/lib/docscribe/infer.rb +110 -259
- data/lib/docscribe/inline_rewriter/collector.rb +845 -0
- data/lib/docscribe/inline_rewriter/doc_block.rb +383 -0
- data/lib/docscribe/inline_rewriter/doc_builder.rb +605 -0
- data/lib/docscribe/inline_rewriter/source_helpers.rb +228 -0
- data/lib/docscribe/inline_rewriter/tag_sorter.rb +244 -0
- data/lib/docscribe/inline_rewriter.rb +604 -425
- data/lib/docscribe/parsing.rb +120 -0
- data/lib/docscribe/types/provider_chain.rb +37 -0
- data/lib/docscribe/types/rbs/provider.rb +213 -0
- data/lib/docscribe/types/rbs/type_formatter.rb +132 -0
- data/lib/docscribe/types/signature.rb +65 -0
- data/lib/docscribe/types/sorbet/base_provider.rb +217 -0
- data/lib/docscribe/types/sorbet/rbi_provider.rb +35 -0
- data/lib/docscribe/types/sorbet/source_provider.rb +25 -0
- data/lib/docscribe/version.rb +1 -1
- data/lib/docscribe.rb +1 -0
- metadata +85 -17
- data/.rspec +0 -3
- data/.rubocop.yml +0 -11
- data/.rubocop_todo.yml +0 -73
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -73
- data/Rakefile +0 -12
- data/rakelib/docs.rake +0 -73
- data/stingray_docs_internal.gemspec +0 -41
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'docscribe/types/signature'
|
|
4
|
+
require 'docscribe/types/rbs/type_formatter'
|
|
5
|
+
|
|
6
|
+
module Docscribe
|
|
7
|
+
module Types
|
|
8
|
+
module Sorbet
|
|
9
|
+
# Shared base for Sorbet-backed signature providers.
|
|
10
|
+
#
|
|
11
|
+
# This class parses Sorbet-style signatures through the RBS RBI prototype
|
|
12
|
+
# API and indexes them into Docscribe's normalized signature model.
|
|
13
|
+
#
|
|
14
|
+
# Concrete subclasses decide where the Sorbet source comes from:
|
|
15
|
+
# - SourceProvider => inline `sig` declarations in the current Ruby file
|
|
16
|
+
# - RBIProvider => project RBI files
|
|
17
|
+
class BaseProvider
|
|
18
|
+
# @param [Boolean] collapse_generics whether generic container details
|
|
19
|
+
# should be simplified during formatting
|
|
20
|
+
# @return [Object]
|
|
21
|
+
def initialize(collapse_generics: false)
|
|
22
|
+
require 'rbs'
|
|
23
|
+
@collapse_generics = !!collapse_generics
|
|
24
|
+
@index = {}
|
|
25
|
+
@warned = false
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Look up a normalized method signature by container, scope, and name.
|
|
29
|
+
#
|
|
30
|
+
# @param [String] container e.g. "MyModule::MyClass"
|
|
31
|
+
# @param [Symbol] scope :instance or :class
|
|
32
|
+
# @param [Symbol, String] name method name
|
|
33
|
+
# @return [Docscribe::Types::MethodSignature, nil]
|
|
34
|
+
def signature_for(container:, scope:, name:)
|
|
35
|
+
@index[[normalize_container(container), scope.to_sym, name.to_sym]]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private
|
|
39
|
+
|
|
40
|
+
# Parse Sorbet-flavored Ruby/RBI source and index any signatures found.
|
|
41
|
+
#
|
|
42
|
+
# Parsing failures are treated as non-fatal so Docscribe can fall back to
|
|
43
|
+
# other providers or plain inference.
|
|
44
|
+
#
|
|
45
|
+
# @private
|
|
46
|
+
# @param [String] source source text to parse
|
|
47
|
+
# @param [String] label file label used in debug warnings
|
|
48
|
+
# @raise [LoadError]
|
|
49
|
+
# @raise [::RBS::BaseError]
|
|
50
|
+
# @raise [SyntaxError]
|
|
51
|
+
# @raise [StandardError]
|
|
52
|
+
# @return [void]
|
|
53
|
+
def load_from_string(source, label:)
|
|
54
|
+
return unless defined?(RubyVM::AbstractSyntaxTree)
|
|
55
|
+
|
|
56
|
+
parser = ::RBS::Prototype::RBI.new
|
|
57
|
+
parser.parse(source)
|
|
58
|
+
index_decls(parser.decls)
|
|
59
|
+
rescue LoadError
|
|
60
|
+
nil
|
|
61
|
+
rescue ::RBS::BaseError, SyntaxError, StandardError => e
|
|
62
|
+
warn_once("Docscribe: Sorbet signature load failed for #{label}: #{e.class}: #{e.message}")
|
|
63
|
+
nil
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Index parsed declarations into the provider lookup table.
|
|
67
|
+
#
|
|
68
|
+
# @private
|
|
69
|
+
# @param [Array<Object>] decls parsed RBS declarations
|
|
70
|
+
# @return [void]
|
|
71
|
+
def index_decls(decls)
|
|
72
|
+
Array(decls).each do |decl|
|
|
73
|
+
next unless decl.respond_to?(:name)
|
|
74
|
+
next unless decl.respond_to?(:members)
|
|
75
|
+
|
|
76
|
+
container = normalize_container(decl.name.to_s)
|
|
77
|
+
|
|
78
|
+
decl.members.each do |member|
|
|
79
|
+
next unless method_definition_member?(member)
|
|
80
|
+
|
|
81
|
+
scope = member.kind == :singleton ? :class : :instance
|
|
82
|
+
overload = member.overloads&.first
|
|
83
|
+
next unless overload
|
|
84
|
+
|
|
85
|
+
func = overload.method_type.type
|
|
86
|
+
@index[[container, scope, member.name.to_s.to_sym]] = build_signature(func)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# @private
|
|
92
|
+
# @param [Object] member
|
|
93
|
+
# @return [Boolean]
|
|
94
|
+
def method_definition_member?(member)
|
|
95
|
+
defined?(::RBS::AST::Members::MethodDefinition) &&
|
|
96
|
+
member.is_a?(::RBS::AST::Members::MethodDefinition)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Convert an RBS function type into Docscribe's simplified signature model.
|
|
100
|
+
#
|
|
101
|
+
# @private
|
|
102
|
+
# @param [::RBS::Types::Function] func
|
|
103
|
+
# @return [Docscribe::Types::MethodSignature]
|
|
104
|
+
def build_signature(func)
|
|
105
|
+
MethodSignature.new(
|
|
106
|
+
return_type: format_type(func.return_type),
|
|
107
|
+
param_types: build_param_types(func),
|
|
108
|
+
rest_positional: build_rest_positional(func),
|
|
109
|
+
rest_keywords: build_rest_keywords(func)
|
|
110
|
+
)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Build a name => type map for ordinary positional/keyword parameters.
|
|
114
|
+
#
|
|
115
|
+
# @private
|
|
116
|
+
# @param [::RBS::Types::Function] func
|
|
117
|
+
# @return [Hash{String => String}]
|
|
118
|
+
def build_param_types(func)
|
|
119
|
+
param_types = {}
|
|
120
|
+
|
|
121
|
+
add_positionals!(param_types, func.required_positionals)
|
|
122
|
+
add_positionals!(param_types, func.optional_positionals)
|
|
123
|
+
add_positionals!(param_types, func.trailing_positionals)
|
|
124
|
+
|
|
125
|
+
func.required_keywords.each { |kw, p| param_types[kw.to_s] = format_type(p.type) }
|
|
126
|
+
func.optional_keywords.each { |kw, p| param_types[kw.to_s] = format_type(p.type) }
|
|
127
|
+
|
|
128
|
+
param_types
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Add positional parameters with names to the normalized param map.
|
|
132
|
+
#
|
|
133
|
+
# @private
|
|
134
|
+
# @param [Hash{String => String}] param_types
|
|
135
|
+
# @param [Array<Object>] list
|
|
136
|
+
# @return [void]
|
|
137
|
+
def add_positionals!(param_types, list)
|
|
138
|
+
list.each do |p|
|
|
139
|
+
next unless p.name
|
|
140
|
+
|
|
141
|
+
param_types[p.name.to_s] = format_type(p.type)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Build normalized `*args` metadata.
|
|
146
|
+
#
|
|
147
|
+
# @private
|
|
148
|
+
# @param [::RBS::Types::Function] func
|
|
149
|
+
# @return [Docscribe::Types::RestPositional, nil]
|
|
150
|
+
def build_rest_positional(func)
|
|
151
|
+
rp = func.rest_positionals
|
|
152
|
+
return nil unless rp
|
|
153
|
+
|
|
154
|
+
RestPositional.new(
|
|
155
|
+
name: rp.name&.to_s,
|
|
156
|
+
element_type: format_type(rp.type)
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Build normalized `**kwargs` metadata.
|
|
161
|
+
#
|
|
162
|
+
# Sorbet keyword-rest signatures describe the value type. For generated
|
|
163
|
+
# YARD output, we expose that as a Hash keyed by Symbol.
|
|
164
|
+
#
|
|
165
|
+
# @private
|
|
166
|
+
# @param [::RBS::Types::Function] func
|
|
167
|
+
# @return [Docscribe::Types::RestKeywords, nil]
|
|
168
|
+
def build_rest_keywords(func)
|
|
169
|
+
rk = func.rest_keywords
|
|
170
|
+
return nil unless rk
|
|
171
|
+
|
|
172
|
+
value_type = format_type(rk.type)
|
|
173
|
+
|
|
174
|
+
RestKeywords.new(
|
|
175
|
+
name: rk.name&.to_s,
|
|
176
|
+
type: "Hash<Symbol, #{value_type}>"
|
|
177
|
+
)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# Format an RBS type object into the YARD-ish type syntax used by
|
|
181
|
+
# generated comments.
|
|
182
|
+
#
|
|
183
|
+
# @private
|
|
184
|
+
# @param [Object] type
|
|
185
|
+
# @return [String]
|
|
186
|
+
def format_type(type)
|
|
187
|
+
Docscribe::Types::RBS::TypeFormatter.to_yard(
|
|
188
|
+
type,
|
|
189
|
+
collapse_generics: @collapse_generics
|
|
190
|
+
)
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Normalize container names so lookups are consistent.
|
|
194
|
+
#
|
|
195
|
+
# @private
|
|
196
|
+
# @param [String] name
|
|
197
|
+
# @return [String]
|
|
198
|
+
def normalize_container(name)
|
|
199
|
+
name.to_s.delete_prefix('::')
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Print one debug warning per provider instance when debugging is enabled.
|
|
203
|
+
#
|
|
204
|
+
# @private
|
|
205
|
+
# @param [String] msg
|
|
206
|
+
# @return [void]
|
|
207
|
+
def warn_once(msg)
|
|
208
|
+
return unless ENV['DOCSCRIBE_RBS_DEBUG'] == '1'
|
|
209
|
+
return if @warned
|
|
210
|
+
|
|
211
|
+
@warned = true
|
|
212
|
+
warn msg
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'pathname'
|
|
4
|
+
require 'docscribe/types/sorbet/base_provider'
|
|
5
|
+
|
|
6
|
+
module Docscribe
|
|
7
|
+
module Types
|
|
8
|
+
module Sorbet
|
|
9
|
+
# Sorbet provider that loads signatures from RBI directories.
|
|
10
|
+
#
|
|
11
|
+
# Each configured directory is scanned recursively for `.rbi` files, and
|
|
12
|
+
# any signatures that can be parsed are indexed into Docscribe's normalized
|
|
13
|
+
# signature model.
|
|
14
|
+
class RBIProvider < BaseProvider
|
|
15
|
+
# @param [Array<String>] rbi_dirs directories scanned recursively for
|
|
16
|
+
# `.rbi` files
|
|
17
|
+
# @param [Boolean] collapse_generics whether generic container types
|
|
18
|
+
# should be simplified during formatting
|
|
19
|
+
# @return [Object]
|
|
20
|
+
def initialize(rbi_dirs:, collapse_generics: false)
|
|
21
|
+
super(collapse_generics: collapse_generics)
|
|
22
|
+
|
|
23
|
+
Array(rbi_dirs).each do |dir|
|
|
24
|
+
path = Pathname(dir)
|
|
25
|
+
next unless path.directory?
|
|
26
|
+
|
|
27
|
+
path.glob('**/*.rbi').sort.each do |file|
|
|
28
|
+
load_from_string(file.read, label: file.to_s)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'docscribe/types/sorbet/base_provider'
|
|
4
|
+
|
|
5
|
+
module Docscribe
|
|
6
|
+
module Types
|
|
7
|
+
module Sorbet
|
|
8
|
+
# Sorbet provider for inline signatures present in the current Ruby source.
|
|
9
|
+
#
|
|
10
|
+
# This provider parses the source being rewritten and indexes any leading
|
|
11
|
+
# `sig` declarations it can resolve through the RBS RBI prototype bridge.
|
|
12
|
+
class SourceProvider < BaseProvider
|
|
13
|
+
# @param [String] source Ruby source containing inline `sig` declarations
|
|
14
|
+
# @param [String] file source label used in diagnostics/debug warnings
|
|
15
|
+
# @param [Boolean] collapse_generics whether generic container types
|
|
16
|
+
# should be simplified during formatting
|
|
17
|
+
# @return [Object]
|
|
18
|
+
def initialize(source:, file:, collapse_generics: false)
|
|
19
|
+
super(collapse_generics: collapse_generics)
|
|
20
|
+
load_from_string(source, label: file)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/docscribe/version.rb
CHANGED
data/lib/docscribe.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: docscribe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- unurgunite
|
|
@@ -15,14 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '3.
|
|
18
|
+
version: '3.3'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '3.
|
|
25
|
+
version: '3.3'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: prism
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '1.8'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '1.8'
|
|
26
40
|
- !ruby/object:Gem::Dependency
|
|
27
41
|
name: rake
|
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -65,6 +79,34 @@ dependencies:
|
|
|
65
79
|
- - ">="
|
|
66
80
|
- !ruby/object:Gem::Version
|
|
67
81
|
version: '0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: rubocop-rake
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: rubocop-rspec
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
type: :development
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - ">="
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
68
110
|
- !ruby/object:Gem::Dependency
|
|
69
111
|
name: rubocop-sorted_methods_by_call
|
|
70
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -85,14 +127,14 @@ dependencies:
|
|
|
85
127
|
requirements:
|
|
86
128
|
- - ">="
|
|
87
129
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.9.
|
|
130
|
+
version: 0.9.38
|
|
89
131
|
type: :development
|
|
90
132
|
prerelease: false
|
|
91
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
134
|
requirements:
|
|
93
135
|
- - ">="
|
|
94
136
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.9.
|
|
137
|
+
version: 0.9.38
|
|
96
138
|
email:
|
|
97
139
|
- senpaiguru1488@gmail.com
|
|
98
140
|
executables:
|
|
@@ -100,25 +142,51 @@ executables:
|
|
|
100
142
|
extensions: []
|
|
101
143
|
extra_rdoc_files: []
|
|
102
144
|
files:
|
|
103
|
-
- ".rspec"
|
|
104
|
-
- ".rubocop.yml"
|
|
105
|
-
- ".rubocop_todo.yml"
|
|
106
|
-
- CODE_OF_CONDUCT.md
|
|
107
|
-
- Gemfile
|
|
108
|
-
- Gemfile.lock
|
|
109
145
|
- LICENSE.txt
|
|
110
146
|
- README.md
|
|
111
|
-
- Rakefile
|
|
112
147
|
- exe/docscribe
|
|
113
148
|
- lib/docscribe.rb
|
|
149
|
+
- lib/docscribe/cli.rb
|
|
150
|
+
- lib/docscribe/cli/config_builder.rb
|
|
151
|
+
- lib/docscribe/cli/init.rb
|
|
152
|
+
- lib/docscribe/cli/options.rb
|
|
153
|
+
- lib/docscribe/cli/run.rb
|
|
114
154
|
- lib/docscribe/config.rb
|
|
155
|
+
- lib/docscribe/config/defaults.rb
|
|
156
|
+
- lib/docscribe/config/emit.rb
|
|
157
|
+
- lib/docscribe/config/filtering.rb
|
|
158
|
+
- lib/docscribe/config/loader.rb
|
|
159
|
+
- lib/docscribe/config/rbs.rb
|
|
160
|
+
- lib/docscribe/config/sorbet.rb
|
|
161
|
+
- lib/docscribe/config/sorting.rb
|
|
162
|
+
- lib/docscribe/config/template.rb
|
|
163
|
+
- lib/docscribe/config/utils.rb
|
|
115
164
|
- lib/docscribe/infer.rb
|
|
165
|
+
- lib/docscribe/infer/ast_walk.rb
|
|
166
|
+
- lib/docscribe/infer/constants.rb
|
|
167
|
+
- lib/docscribe/infer/literals.rb
|
|
168
|
+
- lib/docscribe/infer/names.rb
|
|
169
|
+
- lib/docscribe/infer/params.rb
|
|
170
|
+
- lib/docscribe/infer/raises.rb
|
|
171
|
+
- lib/docscribe/infer/returns.rb
|
|
116
172
|
- lib/docscribe/inline_rewriter.rb
|
|
173
|
+
- lib/docscribe/inline_rewriter/collector.rb
|
|
174
|
+
- lib/docscribe/inline_rewriter/doc_block.rb
|
|
175
|
+
- lib/docscribe/inline_rewriter/doc_builder.rb
|
|
176
|
+
- lib/docscribe/inline_rewriter/source_helpers.rb
|
|
177
|
+
- lib/docscribe/inline_rewriter/tag_sorter.rb
|
|
178
|
+
- lib/docscribe/parsing.rb
|
|
179
|
+
- lib/docscribe/types/provider_chain.rb
|
|
180
|
+
- lib/docscribe/types/rbs/provider.rb
|
|
181
|
+
- lib/docscribe/types/rbs/type_formatter.rb
|
|
182
|
+
- lib/docscribe/types/signature.rb
|
|
183
|
+
- lib/docscribe/types/sorbet/base_provider.rb
|
|
184
|
+
- lib/docscribe/types/sorbet/rbi_provider.rb
|
|
185
|
+
- lib/docscribe/types/sorbet/source_provider.rb
|
|
117
186
|
- lib/docscribe/version.rb
|
|
118
|
-
- rakelib/docs.rake
|
|
119
|
-
- stingray_docs_internal.gemspec
|
|
120
187
|
homepage: https://github.com/unurgunite/docscribe
|
|
121
|
-
licenses:
|
|
188
|
+
licenses:
|
|
189
|
+
- MIT
|
|
122
190
|
metadata:
|
|
123
191
|
homepage_uri: https://github.com/unurgunite/docscribe
|
|
124
192
|
source_code_uri: https://github.com/unurgunite/docscribe
|
|
@@ -131,14 +199,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
131
199
|
requirements:
|
|
132
200
|
- - ">="
|
|
133
201
|
- !ruby/object:Gem::Version
|
|
134
|
-
version: '
|
|
202
|
+
version: '2.7'
|
|
135
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
204
|
requirements:
|
|
137
205
|
- - ">="
|
|
138
206
|
- !ruby/object:Gem::Version
|
|
139
207
|
version: '0'
|
|
140
208
|
requirements: []
|
|
141
|
-
rubygems_version:
|
|
209
|
+
rubygems_version: 4.0.9
|
|
142
210
|
specification_version: 4
|
|
143
211
|
summary: Autogenerate documentation for Ruby code with YARD syntax.
|
|
144
212
|
test_files: []
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.rubocop_todo.yml
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2025-11-12 20:29:05 UTC using RuboCop version 1.81.7.
|
|
4
|
-
# The point is for the user to remove these configuration records
|
|
5
|
-
# one by one as the offenses are removed from the code base.
|
|
6
|
-
# Note that changes in the inspected code, or installation of new
|
|
7
|
-
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
-
|
|
9
|
-
# Offense count: 5
|
|
10
|
-
# Configuration parameters: EnforcedStyle, AllowedGems.
|
|
11
|
-
# SupportedStyles: Gemfile, gems.rb, gemspec
|
|
12
|
-
Gemspec/DevelopmentDependencies:
|
|
13
|
-
Exclude:
|
|
14
|
-
- 'stingray_docs_internal.gemspec'
|
|
15
|
-
|
|
16
|
-
# Offense count: 10
|
|
17
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
18
|
-
Metrics/AbcSize:
|
|
19
|
-
Max: 62
|
|
20
|
-
|
|
21
|
-
# Offense count: 7
|
|
22
|
-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
23
|
-
# AllowedMethods: refine
|
|
24
|
-
Metrics/BlockLength:
|
|
25
|
-
Max: 49
|
|
26
|
-
|
|
27
|
-
# Offense count: 3
|
|
28
|
-
# Configuration parameters: CountComments, CountAsOne.
|
|
29
|
-
Metrics/ClassLength:
|
|
30
|
-
Max: 187
|
|
31
|
-
|
|
32
|
-
# Offense count: 11
|
|
33
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
34
|
-
Metrics/CyclomaticComplexity:
|
|
35
|
-
Max: 23
|
|
36
|
-
|
|
37
|
-
# Offense count: 13
|
|
38
|
-
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
39
|
-
Metrics/MethodLength:
|
|
40
|
-
Max: 47
|
|
41
|
-
|
|
42
|
-
# Offense count: 2
|
|
43
|
-
# Configuration parameters: CountComments, CountAsOne.
|
|
44
|
-
Metrics/ModuleLength:
|
|
45
|
-
Max: 189
|
|
46
|
-
|
|
47
|
-
# Offense count: 10
|
|
48
|
-
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
49
|
-
Metrics/PerceivedComplexity:
|
|
50
|
-
Max: 22
|
|
51
|
-
|
|
52
|
-
# Offense count: 3
|
|
53
|
-
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
|
54
|
-
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
|
|
55
|
-
Naming/MethodParameterName:
|
|
56
|
-
Exclude:
|
|
57
|
-
- 'lib/docscribe/infer.rb'
|
|
58
|
-
|
|
59
|
-
# Offense count: 4
|
|
60
|
-
# Configuration parameters: AllowedConstants.
|
|
61
|
-
Style/Documentation:
|
|
62
|
-
Exclude:
|
|
63
|
-
- 'spec/**/*'
|
|
64
|
-
- 'test/**/*'
|
|
65
|
-
- 'lib/docscribe/config.rb'
|
|
66
|
-
- 'lib/docscribe/infer.rb'
|
|
67
|
-
- 'lib/docscribe/inline_rewriter.rb'
|
|
68
|
-
|
|
69
|
-
# Offense count: 2
|
|
70
|
-
# Configuration parameters: Max.
|
|
71
|
-
Style/SafeNavigationChainLength:
|
|
72
|
-
Exclude:
|
|
73
|
-
- 'lib/docscribe/inline_rewriter.rb'
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
-
|
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
-
|
|
9
|
-
## Our Standards
|
|
10
|
-
|
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
-
|
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
-
|
|
19
|
-
Examples of unacceptable behavior include:
|
|
20
|
-
|
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
22
|
-
advances of any kind
|
|
23
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
-
* Public or private harassment
|
|
25
|
-
* Publishing others' private information, such as a physical or email
|
|
26
|
-
address, without their explicit permission
|
|
27
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
28
|
-
professional setting
|
|
29
|
-
|
|
30
|
-
## Enforcement Responsibilities
|
|
31
|
-
|
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
33
|
-
|
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
35
|
-
|
|
36
|
-
## Scope
|
|
37
|
-
|
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
39
|
-
|
|
40
|
-
## Enforcement
|
|
41
|
-
|
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at senpaiguru1488@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
|
|
43
|
-
|
|
44
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
45
|
-
|
|
46
|
-
## Enforcement Guidelines
|
|
47
|
-
|
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
49
|
-
|
|
50
|
-
### 1. Correction
|
|
51
|
-
|
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
53
|
-
|
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
55
|
-
|
|
56
|
-
### 2. Warning
|
|
57
|
-
|
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
|
59
|
-
|
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
61
|
-
|
|
62
|
-
### 3. Temporary Ban
|
|
63
|
-
|
|
64
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
65
|
-
|
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
67
|
-
|
|
68
|
-
### 4. Permanent Ban
|
|
69
|
-
|
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
71
|
-
|
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
73
|
-
|
|
74
|
-
## Attribution
|
|
75
|
-
|
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
77
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
78
|
-
|
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
80
|
-
|
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
|
82
|
-
|
|
83
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|