Skip to content

swhitty/swift-codeowners

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Codecov Platforms Swift 6.0 License Twitter

Introduction

CodeOwners is a lightweight parser of CODEOWNERS files writted in Swift.

Installation

CodeOwners can be installed by using Swift Package Manager.

Note: CodeOwners requires Swift 6.0 on Xcode 16+. It runs on iOS 16+, tvOS 16+, macOS 13+ and Linux. To install using Swift Package Manager, add this to the dependencies: section in your Package.swift file:

.package(url: "https://github.com/swhitty/swift-codeowners.git", .upToNextMajor(from: "0.1.0"))

Usage

Parse the CODEOWNERS file within a repo:

let co = try CodeOwners(file: URL(filePath: "/code/repo/CODEOWNERS"))

Retrieve the owners for a specific file URL:

let owners = co.owners(for: URL(filePath: "/code/repo/Sources/main.swift"))

Credits

CodeOwners is primarily the work of Simon Whitty.

Much of the heavy lifting is by the excellent swift-glob package by David Beck.

(Full list of contributors)

About

CODEOWNERS parser and utility written in Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages