lib/spoom/sorbet/sigils.rb in spoom-1.2.2 vs lib/spoom/sorbet/sigils.rb in spoom-1.2.3
- old
+ new
@@ -26,11 +26,11 @@
STRICTNESS_INTERNAL,
].freeze,
T::Array[String],
)
- SIGIL_REGEXP = T.let(/^#[\ t]*typed[\ t]*:[ \t]*(\w*)[ \t]*/, Regexp)
+ SIGIL_REGEXP = T.let(/^#[[:blank:]]*typed:[[:blank:]]*(\S*)/, Regexp)
class << self
extend T::Sig
# returns the full sigil comment string for the passed strictness
@@ -59,10 +59,10 @@
# returns a string containing the strictness of a sigil in a file at the passed path
# * returns nil if no sigil
sig { params(path: T.any(String, Pathname)).returns(T.nilable(String)) }
def file_strictness(path)
- return nil unless File.file?(path)
+ return unless File.file?(path)
content = File.read(path, encoding: Encoding::ASCII_8BIT)
strictness_in_content(content)
end