Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
soutaro committed Nov 26, 2024
1 parent 1283b1b commit 53ce41d
Show file tree
Hide file tree
Showing 10 changed files with 2,424 additions and 247 deletions.
8 changes: 4 additions & 4 deletions .vscode/steep-shared.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
"body": [
"# Short explanation ending with `.`",
"#",
"# ### Ruby code",
"# ### RBS",
"#",
"# ```ruby",
"# ```rbs",
"# ```",
"#",
"# ### RBS",
"# ### Ruby code",
"#",
"# ```rbs",
"# ```ruby",
"# ```",
"#",
"# ### Diagnostic",
Expand Down
16 changes: 16 additions & 0 deletions bin/generate-diagnostics-docs.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# rbs_inline: enabled

require "rbs"
require "steep"

class Visitor < RBS::AST::Visitor
attr_reader :output #: Hash[String, String]
Expand Down Expand Up @@ -28,6 +29,21 @@ def format(io)
io.puts
io.puts content
io.puts

configs = [:all_error, :default, :strict, :lenient, :silent]

io.puts "### Severity"
io.puts
io.puts "| #{configs.map { "#{_1}" }.join(" | ")} |"
io.puts "| #{configs.map{"-"}.join(" | ")} |"

line = configs.map {|config|
hash = Steep::Diagnostic::Ruby.__send__(config) #: Hash[Class, untyped]
const =Steep::Diagnostic::Ruby.const_get(key.to_sym)
"#{hash[const] || "-"}"
}
io.puts "| #{line.join(" | ")} |"
io.puts
end
end

Expand Down
Loading

0 comments on commit 53ce41d

Please sign in to comment.