swift

package
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package swift implements a gorisk analyzer for Swift / Swift Package Manager (SPM) projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIRGraph added in v0.4.2

func BuildIRGraph(g *graph.DependencyGraph) ir.IRGraph

BuildIRGraph builds a function-level IR graph for a Swift dependency graph.

func Detect

func Detect(dir string) capability.CapabilitySet

Detect walks .swift files in dir and returns the combined capability set.

func DetectFunctions added in v0.4.2

func DetectFunctions(dir, pkgName string, files []string) (map[string]ir.FunctionCaps, []ir.CallEdge, error)

DetectFunctions parses Swift source files and returns per-function capability sets and call edges.

Types

type Adapter

type Adapter struct{}

Adapter implements the analyzer.Analyzer interface for Swift/SPM projects.

func (*Adapter) Load

func (a *Adapter) Load(dir string) (*graph.DependencyGraph, error)

Load parses the Swift dependency lockfile in dir, detects capabilities from .swift source files, and returns a *graph.DependencyGraph.

func (*Adapter) Name

func (a *Adapter) Name() string

type SwiftPackage

type SwiftPackage struct {
	Name         string
	Version      string
	Direct       bool
	Dependencies []string
}

SwiftPackage represents a Swift/SPM dependency.

func Load

func Load(dir string) (pkgs []SwiftPackage, retErr error)

Load detects and parses the Swift dependency lockfile in dir. Priority: Package.resolved → Package.swift. Load never panics; it returns a structured error on failure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL