-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ | |
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
/.gem_rbs_collection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# D = Steep::Diagnostic | ||
# | ||
# target :lib do | ||
# signature "sig" | ||
# | ||
# check "lib" # Directory name | ||
# check "Gemfile" # File name | ||
# check "app/models/**/*.rb" # Glob | ||
# # ignore "lib/templates/*.rb" | ||
# | ||
# # library "pathname" # Standard libraries | ||
# # library "strong_json" # Gems | ||
# | ||
# # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default) | ||
# # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting | ||
# # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting | ||
# # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting | ||
# # configure_code_diagnostics do |hash| # You can setup everything yourself | ||
# # hash[D::Ruby::NoMethod] = :information | ||
# # end | ||
# end | ||
|
||
# target :test do | ||
# signature "sig", "sig-private" | ||
# | ||
# check "test" | ||
# | ||
# # library "pathname" # Standard libraries | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module RBS | ||
module Inline | ||
module AST | ||
module Member | ||
class RubyDef | ||
end | ||
|
||
class RubyAlias | ||
end | ||
|
||
class RubyMixin | ||
end | ||
|
||
class RubyAttr | ||
end | ||
|
||
class RBSDef | ||
end | ||
|
||
class RBSAlias | ||
end | ||
|
||
class RBSAttr | ||
end | ||
end | ||
|
||
module Declaration | ||
class ModuleDecl | ||
end | ||
|
||
class ClassDecl | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
path: ".gem_rbs_collection" | ||
gems: | ||
- name: abbrev | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: fileutils | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: json | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: logger | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: minitest | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: monitor | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: mutex_m | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: optparse | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: pathname | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: prism | ||
version: 0.24.0 | ||
source: | ||
type: rubygems | ||
- name: rake | ||
version: '13.0' | ||
source: | ||
type: git | ||
name: ruby/gem_rbs_collection | ||
revision: e047afdf7e470acf0d0cdff31bd9c3123be3ea39 | ||
remote: https://github.com/ruby/gem_rbs_collection.git | ||
repo_dir: gems | ||
- name: rbs | ||
version: 3.4.4 | ||
source: | ||
type: rubygems | ||
- name: rdoc | ||
version: '0' | ||
source: | ||
type: stdlib | ||
- name: tsort | ||
version: '0' | ||
source: | ||
type: stdlib | ||
gemfile_lock_path: Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Download sources | ||
sources: | ||
- type: git | ||
name: ruby/gem_rbs_collection | ||
remote: https://github.com/ruby/gem_rbs_collection.git | ||
revision: main | ||
repo_dir: gems | ||
|
||
# You can specify local directories as sources also. | ||
# - type: local | ||
# path: path/to/your/local/repository | ||
|
||
# A directory to install the downloaded RBSs | ||
path: .gem_rbs_collection | ||
|
||
# gems: | ||
# # If you want to avoid installing rbs files for gems, you can specify them here. | ||
# - name: GEM_NAME | ||
# ignore: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module RBS | ||
module Inline | ||
module AST | ||
module Member | ||
type t = MethodDefinition | ||
end | ||
|
||
module Declaration | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "prism" | ||
|
||
ast = Prism.parse_file("yard-samples/sample1.rb") | ||
|
||
pp ast.value | ||
pp ast.comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module Foo | ||
# This is `Foo#foo` method | ||
# | ||
# @param i [Integer] Size of something | ||
# @param j [Symbol,Integer] Something doing meaningful | ||
# @return [String?] Returns a string or nil | ||
# | ||
# | ||
# @rbs.method (Integer, String) -> void | ||
# | [A] () { () [self: String] -> A } -> A? | ||
# | ||
def foo(i, j) | ||
|
||
end | ||
|
||
# @rbs.inline | ||
# attr_reader hoge: String | ||
# attr_reader name: String? | ||
def hoge | ||
|
||
end | ||
|
||
class Foo | ||
# @rbs.inline include Foo[String] | ||
end | ||
end |