Class: Semverve::VersionChecks::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/semverve/version_checks.rb

Overview

Base behavior for check adapters. Public check objects must expose name, task_name, descriptions, labels, findings, and fix.

Instance Method Summary collapse

Instance Method Details

#exact_target_fix_noop_notice?Boolean

Whether findings should print a note when an exact target is already current.

Returns:

  • (Boolean)


135
136
137
# File 'lib/semverve/version_checks.rb', line 135

def exact_target_fix_noop_notice?
  false
end

#findings(_configuration, _current_version, include_ignored: false, target_version: nil) ⇒ Array

Finds mismatches.

Returns:

  • (Array)

Raises:

  • (NotImplementedError)


159
160
161
# File 'lib/semverve/version_checks.rb', line 159

def findings(_configuration, _current_version, include_ignored: false, target_version: nil)
  raise NotImplementedError
end

#fix(_configuration, _current_version, target_version: nil) ⇒ #changed_files, #replacement_count

Fixes mismatches.

Returns:

  • (#changed_files, #replacement_count)

Raises:

  • (NotImplementedError)


167
168
169
# File 'lib/semverve/version_checks.rb', line 167

def fix(_configuration, _current_version, target_version: nil)
  raise NotImplementedError
end

#fix_labelString

Label used when reporting replacement counts.

Returns:

  • (String)


151
152
153
# File 'lib/semverve/version_checks.rb', line 151

def fix_label
  finding_label
end

#targetable?Boolean

Whether focused task accepts an exact target version argument.

Returns:

  • (Boolean)


127
128
129
# File 'lib/semverve/version_checks.rb', line 127

def targetable?
  false
end

#task_argumentsArray<Symbol>

Rake task argument names for the focused task.

Returns:

  • (Array<Symbol>)


143
144
145
# File 'lib/semverve/version_checks.rb', line 143

def task_arguments
  targetable? ? [:version] : []
end