Wednesday, August 3, 2022

SwiftSafeURL: Compile-Time-Checked URLs

Jhonatan Avalos (tweet):

Tool for avoiding using the URL(string:) initializer with optional result, instead introducing a compile time URL validity check. Note, this does not check for website availability, but if the URL is formatted correctly.

[…]

If a file contains the comment // safeurl:warn, invalid URLs in this file will be compiled and will show a warning instead of an error.

It’s cool how straightforward it is these days to write little plug-ins that leverage and extend the compiler.

See also: JP Simard.

Previously:

Comments RSS · Twitter

Leave a Comment