soutaro / steep

Static type checker for Ruby
MIT License
1.37k stars 84 forks source link

library method issue #1244

Open Dandush03 opened 1 month ago

Dandush03 commented 1 month ago

When requiring the ActiveRecord gem it breaks everything

Current config

# frozen_string_literal: true

D = Steep::Diagnostic

target :pg_rls do
  signature "sig"

  check "lib"
  library "active_record"
  # ignore "spec/**/*.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

Untitled

soutaro commented 1 month ago

I recommend using rbs_collection.yaml and gem_rbs_collection instead of directly writing library calls in Steepfile.

https://github.com/ruby/gem_rbs_collection

(And, we don't have active_record gem but activerecord gem. 😅)

aaronmallen commented 1 month ago

@soutaro whats the protocol for gems that don't have signatures and aren't in gem_rbs_collection (i.e. semantic)