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,
lib/audition/static/checks/unshareable_reads.rb,
lib/audition/static/checks/instance_memoization.rb,
lib/audition/static/checks/dependency_class_state.rb

Defined Under Namespace

Classes: Base, DependencyClassState, GlobalVariables, InstanceMemoization, MutableConstants, RactorIsolation, RuntimeRequire, UnsafeCalls, UnshareableReads

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.all ⇒ Array<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



27
28
29
# File 'lib/audition/static/checks.rb', line 27

def self.all
  BUILT_IN + registered
end

.deregister(check) ⇒ void

This method returns an undefined value.

Parameters:

  • check (Class) —

    a previously registered check



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

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



35
36
37
# File 'lib/audition/static/checks.rb', line 35

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

.registered ⇒ Object



45
46
47
# File 'lib/audition/static/checks.rb', line 45

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