Module: Audition::Static::Checks

Defined in:
lib/audition/static/checks.rb,
lib/audition/static/checks/base.rb,
lib/audition/static/checks/unsafe_calls.rb,
lib/audition/static/checks/runtime_require.rb,
lib/audition/static/checks/global_variables.rb,
lib/audition/static/checks/ractor_isolation.rb,
lib/audition/static/checks/mutable_constants.rb

Defined Under Namespace

Classes: Base, GlobalVariables, MutableConstants, RactorIsolation, RuntimeRequire, UnsafeCalls

Constant Summary collapse

BUILT_IN =
[
  GlobalVariables, MutableConstants, RactorIsolation,
  RuntimeRequire, UnsafeCalls
].freeze

Class Method Summary collapse

Class Method Details

.allArray<Class>

Expression-level checks, run per file. Class variables and class-level instance variable state are covered semantically by the rubydex graph audit, not by per-file visitors.

Returns:

  • (Array<Class>)

    built-in plus registered checks



23
24
25
# File 'lib/audition/static/checks.rb', line 23

def self.all
  BUILT_IN + registered
end

.deregister(check) ⇒ void

This method returns an undefined value.

Parameters:

  • check (Class)

    a previously registered check



37
38
39
# File 'lib/audition/static/checks.rb', line 37

def self.deregister(check)
  registered.delete(check)
end

.register(check) ⇒ void

This method returns an undefined value.

Extension point: gems can subclass Base and register here.

Parameters:

  • check (Class)

    a Base subclass



31
32
33
# File 'lib/audition/static/checks.rb', line 31

def self.register(check)
  registered << check
end

.registeredObject



41
42
43
# File 'lib/audition/static/checks.rb', line 41

def self.registered
  @registered ||= [] # audition:disable class-level-state
end