From 50972bfbd226fcc1628f86521bbb58698d4c55e4 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:58:16 -0600 Subject: [PATCH 1/9] Add README --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 55c71f5fcf72abae07200fb0b35be2b88d248864 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sat, 14 Dec 2024 13:36:07 -0600 Subject: [PATCH 2/9] Update README.md Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index e69de29..3466fce 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,22 @@ +# SwiftSyntaxSugar + +SwiftSyntaxSugar is a library that provides syntactic sugar and helpful extensions for [SwiftSyntax](https://github.com/swiftlang/swift-syntax). The purpose of this library is to improve the readability and maintainability of code written using SwiftSyntax. + +## Installation + +To add SwiftSyntaxSugar to a Swift package manifest file: +- Add the SwiftSyntaxSugar package to your package's `dependencies`: + ```swift + .package( + url: "https://github.com/fetch-rewards/SwiftSyntaxSugar.git", + from: "<#latest SwiftSyntaxSugar tag#>" + ) + ``` +- Add the SwiftSyntaxSugar product to your target's `dependencies`: + ```swift + .product(name: "SwiftSyntaxSugar", package: "SwiftSyntaxSugar") + ``` + +## License + +This library is released under the MIT license. See [LICENSE](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/LICENSE) for details. From ffcc8333090a5ce75eb92b4c5c656f9667b37d14 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Fri, 11 Apr 2025 14:51:24 -0500 Subject: [PATCH 3/9] Add Example section Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 3466fce..5d1aaa9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,38 @@ SwiftSyntaxSugar is a library that provides syntactic sugar and helpful extensions for [SwiftSyntax](https://github.com/swiftlang/swift-syntax). The purpose of this library is to improve the readability and maintainability of code written using SwiftSyntax. +- [Example](#example) +- [Installation](#installation) +- [License](#license) + +## Example + + + + + + + + + + +
With SwiftSyntaxSugar Without SwiftSyntaxSugar
+ +```swift +protocolDeclaration.isActorConstrained +``` + + + +```swift +let isProtocolActorConstrained = protocolDeclaration.inheritanceClause?.inheritedTypes.contains { inheritedType in + let identifierType = inheritedType.type.as(IdentifierTypeSyntax.self) + return identifierType.name.tokenKind == .identifier("Actor") +} ?? false +``` + +
+ ## Installation To add SwiftSyntaxSugar to a Swift package manifest file: From aa4d02c5dee2da18499dc4b84327607d341dcf49 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:37:16 -0500 Subject: [PATCH 4/9] Add Contributing section Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5d1aaa9..9f93a60 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,14 @@ To add SwiftSyntaxSugar to a Swift package manifest file: .product(name: "SwiftSyntaxSugar", package: "SwiftSyntaxSugar") ``` +## Contributing + +The simplest way to contribute to this project is to [open an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new/choose). + +If you would like to contribute code to this project, please read our [Contributing Guidelines](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/CONTRIBUTING.md). + +By opening an issue or contributing code to this project, you agree to follow our [Code of Conduct](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/CODE_OF_CONDUCT.md). + ## License This library is released under the MIT license. See [LICENSE](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/LICENSE) for details. From a99c1861569e898b73b959414c042552cbfe645e Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:41:58 -0500 Subject: [PATCH 5/9] Update README.md Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f93a60..6c765bb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ To add SwiftSyntaxSugar to a Swift package manifest file: ## Contributing -The simplest way to contribute to this project is to [open an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new/choose). +The simplest way to contribute to this project is by [opening an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new/choose). If you would like to contribute code to this project, please read our [Contributing Guidelines](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/CONTRIBUTING.md). From 77644f9f9109d7818c73e87023b0bffb39faa1b5 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:47:14 -0500 Subject: [PATCH 6/9] Update issue creation link Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c765bb..f9052ce 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ SwiftSyntaxSugar is a library that provides syntactic sugar and helpful extensio - [Example](#example) - [Installation](#installation) +- [Contributing](#contributing) - [License](#license) ## Example @@ -51,7 +52,7 @@ To add SwiftSyntaxSugar to a Swift package manifest file: ## Contributing -The simplest way to contribute to this project is by [opening an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new/choose). +The simplest way to contribute to this project is by [opening an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new). If you would like to contribute code to this project, please read our [Contributing Guidelines](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/main/CONTRIBUTING.md). From d39531dda7f481516ec6dd5d9aab52d402f07c32 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:49:32 -0500 Subject: [PATCH 7/9] Add code highlighting Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f9052ce..1edd446 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # SwiftSyntaxSugar -SwiftSyntaxSugar is a library that provides syntactic sugar and helpful extensions for [SwiftSyntax](https://github.com/swiftlang/swift-syntax). The purpose of this library is to improve the readability and maintainability of code written using SwiftSyntax. +`SwiftSyntaxSugar` is a library that provides syntactic sugar and helpful extensions for [`SwiftSyntax`](https://github.com/swiftlang/swift-syntax). +The purpose of this library is to improve the readability and maintainability of code written using `SwiftSyntax`. - [Example](#example) - [Installation](#installation) @@ -37,15 +38,15 @@ let isProtocolActorConstrained = protocolDeclaration.inheritanceClause?.inherite ## Installation -To add SwiftSyntaxSugar to a Swift package manifest file: -- Add the SwiftSyntaxSugar package to your package's `dependencies`: +To add `SwiftSyntaxSugar` to a Swift package manifest file: +- Add the `SwiftSyntaxSugar` package to your package's `dependencies`: ```swift .package( url: "https://github.com/fetch-rewards/SwiftSyntaxSugar.git", from: "<#latest SwiftSyntaxSugar tag#>" ) ``` -- Add the SwiftSyntaxSugar product to your target's `dependencies`: +- Add the `SwiftSyntaxSugar` product to your target's `dependencies`: ```swift .product(name: "SwiftSyntaxSugar", package: "SwiftSyntaxSugar") ``` From 164d919079c05a7de43e2bda229b95ed78188866 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Fri, 18 Apr 2025 09:57:35 -0500 Subject: [PATCH 8/9] Add Usage section Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1edd446..c0dcbba 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,26 @@ The purpose of this library is to improve the readability and maintainability of - [Example](#example) - [Installation](#installation) +- [Usage](#usage) - [Contributing](#contributing) - [License](#license) ## Example - +
- -
With SwiftSyntaxSugar Without SwiftSyntaxSugar
+ ```swift protocolDeclaration.isActorConstrained ``` + ```swift let isProtocolActorConstrained = protocolDeclaration.inheritanceClause?.inheritedTypes.contains { inheritedType in @@ -51,6 +52,14 @@ To add `SwiftSyntaxSugar` to a Swift package manifest file: .product(name: "SwiftSyntaxSugar", package: "SwiftSyntaxSugar") ``` +## Usage + +- Import `SwiftSyntaxSugar`: + ```swift + import SwiftSyntaxSugar + ``` +- Use `SwiftSyntax` exactly how you normally would! + ## Contributing The simplest way to contribute to this project is by [opening an issue](https://github.com/fetch-rewards/SwiftSyntaxSugar/issues/new). From 8efce08b4a6dba0bf2a7d260e3a55a530904ac12 Mon Sep 17 00:00:00 2001 From: Gray Campbell <12163070+graycampbell@users.noreply.github.com> Date: Fri, 18 Apr 2025 10:38:07 -0500 Subject: [PATCH 9/9] Add badges Signed-off-by: Gray Campbell <12163070+graycampbell@users.noreply.github.com> --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c0dcbba..4d933f6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # SwiftSyntaxSugar +[![ci](https://github.com/fetch-rewards/SwiftSyntaxSugar/actions/workflows/ci.yml/badge.svg)](https://github.com/fetch-rewards/SwiftSyntaxSugar/actions/workflows/ci.yml?query=branch%3Amain) +[![codecov](https://codecov.io/gh/fetch-rewards/SwiftSyntaxSugar/graph/badge.svg?token=gTqOi09vx5)](https://codecov.io/gh/fetch-rewards/SwiftSyntaxSugar) +[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/fetch-rewards/SwiftSyntaxSugar/blob/feature/readme/LICENSE) + `SwiftSyntaxSugar` is a library that provides syntactic sugar and helpful extensions for [`SwiftSyntax`](https://github.com/swiftlang/swift-syntax). The purpose of this library is to improve the readability and maintainability of code written using `SwiftSyntax`.