Module: FastCodeOwners

Extended by:
T::Helpers, T::Sig
Defined in:
lib/fast_code_owners/team_finder.rb,
lib/fast_code_owners.rb,
lib/fast_code_owners/cli.rb,
lib/fast_code_owners/version.rb,
lib/fast_code_owners/file_path_finder.rb,
lib/fast_code_owners/file_path_team_cache.rb

Overview

typed: strict

Defined Under Namespace

Modules: FilePathFinder, FilePathTeamCache, TeamFinder Classes: Cli

Constant Summary collapse

VERSION =
'0.0.11'

Class Method Summary collapse

Class Method Details

.bust_cache!Object



83
84
85
# File 'lib/fast_code_owners.rb', line 83

def bust_cache!
  FilePathTeamCache.bust_cache!
end

.first_owned_file_for_backtrace(backtrace, excluded_teams: []) ⇒ Object



72
73
74
# File 'lib/fast_code_owners.rb', line 72

def first_owned_file_for_backtrace(backtrace, excluded_teams: [])
  TeamFinder.first_owned_file_for_backtrace(backtrace, excluded_teams: excluded_teams)
end

.for_backtrace(backtrace, excluded_teams: []) ⇒ Object



65
66
67
# File 'lib/fast_code_owners.rb', line 65

def for_backtrace(backtrace, excluded_teams: [])
  TeamFinder.for_backtrace(backtrace, excluded_teams: excluded_teams)
end

.for_class(klass) ⇒ Object



53
54
55
# File 'lib/fast_code_owners.rb', line 53

def for_class(klass)
  TeamFinder.for_class(klass)
end

.for_file(file_path) ⇒ Object



48
49
50
# File 'lib/fast_code_owners.rb', line 48

def for_file(file_path)
  TeamFinder.for_file(file_path)
end

.for_package(package) ⇒ Object



58
59
60
# File 'lib/fast_code_owners.rb', line 58

def for_package(package)
  TeamFinder.for_package(package)
end

.for_team(team) ⇒ Object



77
78
79
80
# File 'lib/fast_code_owners.rb', line 77

def for_team(team)
  team = T.must(CodeTeams.find(team)) if team.is_a?(String)
  ::RustCodeOwners.for_team(team.name)
end

.validate!(autocorrect: true, stage_changes: true, files: nil) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fast_code_owners.rb', line 35

def validate!(
  autocorrect: true,
  stage_changes: true,
  files: nil
)
  if autocorrect
    ::RustCodeOwners.generate_and_validate(!stage_changes)
  else
    ::RustCodeOwners.validate
  end
end