From 109a523c36fae7d912521389f88d6fe43f5a2358 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sat, 15 Nov 2025 16:00:12 +0400 Subject: [PATCH 01/10] Update `README.md` (#20) --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9abe793..a5c8f11 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,14 @@ If you need to validate some data, you can use the `Validator` object for this p import ValidatorCore let validator = Validator() -let result = validator.validate(input: "text", rule: LengthValidationRule(min: 4, error: "error text")) +let result = validator.validate(input: "text", rule: LengthValidationRule(min: 4, error: "Text must be at least 4 characters long")) switch result { case .valid: - print("text is valid") + print("Text is valid") case let .invalid(errors): // handle validation errors - print(errors) + print("Validation errors: \(errors.map(\.message))") } ``` @@ -66,16 +66,16 @@ class ViewController: UIViewController { super.viewDidLoad() /// Adds validation rule to the text field. - textField.add(rule: LengthValidationRule(max: 10, error: "error text")) + textField.add(rule: LengthValidationRule(max: 10, error: "Text must be at most 10 characters")) /// Enables automatic validation on input change. textField.validateOnInputChange(isEnabled: true) /// Handle the validation result. textField.validationHandler = { result in switch result { case .valid: - print("text is valid") + print("Text is valid") case let .invalid(errors): - print(errors) + print("Validation errors: \(errors)") } } } @@ -122,14 +122,14 @@ struct ContentView: View { @State private var text: String = "" private let validationRules: [any IValidationRule] = [ - LengthValidationRule(max: 10, error: "Text error") + LengthValidationRule(max: 10, error: "Text must be at most 10 characters") ] var body: some View { VStack { - TextField("Text", text: $text) + TextField("Enter text", text: $text) .validate(item: $text, rules: validationRules) { errors in - Text("Text is bigger than 10 characters") + Text("Text exceeds 10 characters") } } } @@ -149,10 +149,10 @@ class Form: ObservableObject { @Published var manager = FormFieldManager() - @FormField(rules: [LengthValidationRule(max: 20, error: "The first name is very long")]) + @FormField(rules: [LengthValidationRule(max: 20, error: "First name is too long")]) var firstName: String = "" - @FormField(rules: [LengthValidationRule(min: 5, error: "The last name is too short")]) + @FormField(rules: [LengthValidationRule(min: 5, error: "Last name is too short")]) var lastName: String = "" lazy var firstNameValidationContainer = _firstName.validate(manager: manager) @@ -180,9 +180,9 @@ struct ContentView: View { form.manager.$isValid, perform: { value in if value { - print("The form's fields are valid") + print("All form fields are valid") } else { - print("The form's fields aren't valid") + print("Some form fields are invalid") } } ) From 7fd863dbf8575c19e34d785cba0abda8a0b36502 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Sun, 16 Nov 2025 20:09:46 +0400 Subject: [PATCH 02/10] Add `dependabot.yml` (#21) * Update `dependabot.yml` * Update `CHANGELOG.md` --- .github/dependabot.yml | 30 ++++++++++++++++++++++++++++++ CHANGELOG.md | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0bda337 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,30 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + time: '07:00' + timezone: Europe/Berlin + assignees: + - ns-vasilev + reviewers: + - ns-vasilev + + - package-ecosystem: swift + directory: / + open-pull-requests-limit: 10 + schedule: + interval: daily + time: '07:00' + timezone: Europe/Berlin + assignees: + - ns-vasilev + reviewers: + - ns-vasilev \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 03b5df2..f72272a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,13 @@ All notable changes to this project will be documented in this file. - `1.1.x` Releases - [1.1.0](#110) - `1.0.x` Releases - [1.0.0](#100) | [1.0.1](#101) -## [1.1.0](https://github.com/space-code/validator/releases/tag/1.2.0) +## [Unreleased] + +#### Added +- Add `dependabot.yml` + - Added in Pull Request [#21](https://github.com/space-code/validator/pull/21). + +## [1.2.0](https://github.com/space-code/validator/releases/tag/1.2.0) Released on 2025-11-13. #### Updated From a7a29fa355592007145d60cda789e8b87e266e70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Nov 2025 20:13:13 +0400 Subject: [PATCH 03/10] Bump actions/upload-artifact from 4 to 5 (#23) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 602285e..4a85105 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,7 +80,7 @@ jobs: - uses: actions/checkout@v5 - name: ${{ matrix.name }} run: xcodebuild test -scheme "Validator-Package" -destination "${{ matrix.destination }}" clean -enableCodeCoverage YES -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: ${{ matrix.name }} path: test_output From ecd2983a478d7ab4cf12f9c78ab4fbc28d62e48a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 16 Nov 2025 20:13:28 +0400 Subject: [PATCH 04/10] Bump actions/checkout from 2 to 5 (#22) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- .github/workflows/danger.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a85105..684e245 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: SwiftLint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v5 - name: GitHub Action for SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 with: diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 158ca87..6a0dbaa 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -18,7 +18,7 @@ jobs: ruby-version: 3.1.4 bundler-cache: true - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v5 - name: Setup gems run: | gem install bundler From 304abb5f94185ec742cd85468cb590c2af905280 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Mon, 17 Nov 2025 10:53:06 +0400 Subject: [PATCH 05/10] Update `Mintfile` (#24) * Update `Mintfile` * Update `CHANGELOG.md` --- CHANGELOG.md | 4 ++++ Mintfile | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f72272a..8c586f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. - Add `dependabot.yml` - Added in Pull Request [#21](https://github.com/space-code/validator/pull/21). +#### Updated +- Update `Mintfile` + - Updated in Pull Request [#22](https://github.com/space-code/validator/pull/22). + ## [1.2.0](https://github.com/space-code/validator/releases/tag/1.2.0) Released on 2025-11-13. diff --git a/Mintfile b/Mintfile index ebeb1c1..4ca9786 100644 --- a/Mintfile +++ b/Mintfile @@ -1,2 +1,2 @@ -nicklockwood/SwiftFormat@0.54.0 -realm/SwiftLint@0.55.1 +nicklockwood/SwiftFormat@0.58.6 +realm/SwiftLint@0.62.2 \ No newline at end of file From 4e0330079e9913b903e42e34e25b812a18860bb0 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 18 Nov 2025 10:20:55 +0400 Subject: [PATCH 06/10] Add `URLValidationRule` implementation (#25) * Add `URLValidationRule` implementation * Write unit tests for `URLValidationRule` * Update `README.md` * Update `CHANGELOG.md` --- CHANGELOG.md | 2 + README.md | 1 + .../Classes/Rules/URLValidationRule.swift | 31 +++++ .../Rules/URLValidationRuleTests.swift | 123 ++++++++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 Sources/ValidatorCore/Classes/Rules/URLValidationRule.swift create mode 100644 Tests/ValidatorCoreTests/UnitTests/Rules/URLValidationRuleTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c586f3..2db31e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file. #### Added - Add `dependabot.yml` - Added in Pull Request [#21](https://github.com/space-code/validator/pull/21). +- Add `URLValidationRule`. + - Added in Pull Request [#25](https://github.com/space-code/validator/pull/25). #### Updated - Update `Mintfile` diff --git a/README.md b/README.md index a5c8f11..cc1e0cb 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ struct ContentView: View { | **PrefixValidationRule** | To validate whether a string contains a prefix | | **SuffixValidationRule** | To validate whether a string contains a suffix | | **RegexValidationRule** | To validate if a pattern is matched | +| **URLValidationRule** | To validate whether a string contains a URL | ## Custom Validation Rules diff --git a/Sources/ValidatorCore/Classes/Rules/URLValidationRule.swift b/Sources/ValidatorCore/Classes/Rules/URLValidationRule.swift new file mode 100644 index 0000000..c52f6ae --- /dev/null +++ b/Sources/ValidatorCore/Classes/Rules/URLValidationRule.swift @@ -0,0 +1,31 @@ +// +// Validator +// Copyright © 2025 Space Code. All rights reserved. +// + +import Foundation + +/// A url validation rule. +public struct URLValidationRule: IValidationRule { + // MARK: Types + + public typealias Input = String + + // MARK: Properties + + /// The validation error. + public let error: IValidationError + + // MARK: Initialization + + public init(error: IValidationError) { + self.error = error + } + + // MARK: IValidationRule + + public func validate(input: String) -> Bool { + guard let url = URL(string: input) else { return false } + return url.isFileURL || (url.host != nil && url.scheme != nil) + } +} diff --git a/Tests/ValidatorCoreTests/UnitTests/Rules/URLValidationRuleTests.swift b/Tests/ValidatorCoreTests/UnitTests/Rules/URLValidationRuleTests.swift new file mode 100644 index 0000000..b95358e --- /dev/null +++ b/Tests/ValidatorCoreTests/UnitTests/Rules/URLValidationRuleTests.swift @@ -0,0 +1,123 @@ +// +// Validator +// Copyright © 2025 Space Code. All rights reserved. +// + +import ValidatorCore +import XCTest + +// MARK: - URLValidationRuleTests + +final class URLValidationRuleTests: XCTestCase { + // MARK: - Properties + + private var sut: URLValidationRule! + + // MARK: - Setup + + override func setUp() { + super.setUp() + sut = URLValidationRule(error: String.error) + } + + override func tearDown() { + sut = nil + super.tearDown() + } + + // MARK: - Tests + + func test_validate_validURL_shouldReturnTrue() { + // given + let url = "https://google.com" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertTrue(result) + } + + func test_validate_missingScheme_shouldReturnFalse() { + // given + let url = "google.com" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertFalse(result) + } + + func test_validate_missingHost_shouldReturnFalse() { + // given + let url = "https://" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertFalse(result) + } + + func test_validate_emptyString_shouldReturnFalse() { + // given + let url = "" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertFalse(result) + } + + func test_validate_whitespaceString_shouldReturnFalse() { + // given + let url = " " + + // when + let result = sut.validate(input: url) + + // then + XCTAssertFalse(result) + } + + func test_validate_ipAddressURL_shouldReturnTrue() { + // given + let url = "http://192.168.0.1" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertTrue(result) + } + + func test_validate_urlWithPort_shouldReturnTrue() { + // given + let url = "https://localhost:8080" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertTrue(result) + } + + func test_validate_ftpScheme_shouldReturnTrue() { + // given + let url = "ftp://example.com" + + // when + let result = sut.validate(input: url) + + // then + XCTAssertTrue(result) + } +} + +// MARK: Constants + +private extension String { + static let error = "URL is invalid" +} From e1e8ef1ac8fa872b4ba34f97cfedfa7c11c51a3e Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 18 Nov 2025 10:33:23 +0400 Subject: [PATCH 07/10] Add `CreditCardValidationRule` implementation (#26) * Add `CreditCardValidationRule` implementation * Write unit tests for `CreditCardValidationRule` * Update `README.md` * Update `CHANGELOG.md` --- CHANGELOG.md | 2 + README.md | 1 + .../Rules/CreditCardValidationRule.swift | 76 ++++++++ .../Rules/CreditCardValidationRuleTests.swift | 164 ++++++++++++++++++ 4 files changed, 243 insertions(+) create mode 100644 Sources/ValidatorCore/Classes/Rules/CreditCardValidationRule.swift create mode 100644 Tests/ValidatorCoreTests/UnitTests/Rules/CreditCardValidationRuleTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db31e8..792f1e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ All notable changes to this project will be documented in this file. - Added in Pull Request [#21](https://github.com/space-code/validator/pull/21). - Add `URLValidationRule`. - Added in Pull Request [#25](https://github.com/space-code/validator/pull/25). +- Add `CreditCardValidationRule`. + - Added in Pull Request [#26](https://github.com/space-code/validator/pull/26). #### Updated - Update `Mintfile` diff --git a/README.md b/README.md index cc1e0cb..68351f4 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ struct ContentView: View { | **SuffixValidationRule** | To validate whether a string contains a suffix | | **RegexValidationRule** | To validate if a pattern is matched | | **URLValidationRule** | To validate whether a string contains a URL | +| **CreditCardValidationRule** | To validate whether a string has a valid credit card number | ## Custom Validation Rules diff --git a/Sources/ValidatorCore/Classes/Rules/CreditCardValidationRule.swift b/Sources/ValidatorCore/Classes/Rules/CreditCardValidationRule.swift new file mode 100644 index 0000000..76c2c70 --- /dev/null +++ b/Sources/ValidatorCore/Classes/Rules/CreditCardValidationRule.swift @@ -0,0 +1,76 @@ +// +// Validator +// Copyright © 2025 Space Code. All rights reserved. +// + +/// A credit card validation rule. +public struct CreditCardValidationRule: IValidationRule { + // MARK: Types + + public enum CardType: String, Sendable, CaseIterable { + case visa, masterCard, amex, jcb, unionPay + } + + public typealias Input = String + + // MARK: Properties + + public let types: [CardType] + + /// The validation error. + public let error: IValidationError + + // MARK: Initialization + + public init(types: [CardType] = CardType.allCases, error: IValidationError) { + self.types = types + self.error = error + } + + // MARK: IValidationRule + + public func validate(input: String) -> Bool { + let sanitized = input.replacingOccurrences(of: " ", with: "") + + guard sanitized.allSatisfy(\.isNumber) else { return false } + + guard types.contains(where: { matches(cardNumber: sanitized, type: $0) }) else { return false } + + return isValidLuhn(sanitized) + } + + // MARK: Private + + private func matches(cardNumber: String, type: CardType) -> Bool { + switch type { + case .visa: + cardNumber.hasPrefix("4") && (cardNumber.count == 13 || cardNumber.count == 16 || cardNumber.count == 19) + case .masterCard: + (cardNumber.hasPrefix("51") || cardNumber.hasPrefix("52") || + cardNumber.hasPrefix("53") || cardNumber.hasPrefix("54") || + cardNumber.hasPrefix("55")) && cardNumber.count == 16 + case .amex: + (cardNumber.hasPrefix("34") || cardNumber.hasPrefix("37")) && cardNumber.count == 15 + case .jcb: + (cardNumber.hasPrefix("3528") || cardNumber.hasPrefix("3589")) && cardNumber.count == 16 + case .unionPay: + cardNumber.hasPrefix("62") && (cardNumber.count >= 16 && cardNumber.count <= 19) + } + } + + private func isValidLuhn(_ cardNumber: String) -> Bool { + let reversedDigits = cardNumber.reversed().map { Int(String($0)) ?? 0 } + var sum = 0 + + for (index, digit) in reversedDigits.enumerated() { + if !index.isMultiple(of: 2) { + let doubled = digit * 2 + sum += doubled > 9 ? doubled - 9 : doubled + } else { + sum += digit + } + } + + return sum.isMultiple(of: 10) + } +} diff --git a/Tests/ValidatorCoreTests/UnitTests/Rules/CreditCardValidationRuleTests.swift b/Tests/ValidatorCoreTests/UnitTests/Rules/CreditCardValidationRuleTests.swift new file mode 100644 index 0000000..9ac1993 --- /dev/null +++ b/Tests/ValidatorCoreTests/UnitTests/Rules/CreditCardValidationRuleTests.swift @@ -0,0 +1,164 @@ +// +// Validator +// Copyright © 2025 Space Code. All rights reserved. +// + +@testable import ValidatorCore +import XCTest + +// MARK: - CreditCardValidationRuleTests + +final class CreditCardValidationRuleTests: XCTestCase { + // MARK: - Visa + + func test_validate_visaCardValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.visa], error: String.error) + let validVisa = "4111111111111111" + + // when + let isValid = rule.validate(input: validVisa) + + // then + XCTAssertTrue(isValid) + } + + func test_validate_visaCardInvalid_shouldReturnFalse() { + // given + let rule = CreditCardValidationRule(types: [.visa], error: String.error) + let invalidVisa = "411111111111112" + + // when + let isValid = rule.validate(input: invalidVisa) + + // then + XCTAssertFalse(isValid) + } + + // MARK: - MasterCard + + func test_validate_masterCardValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.masterCard], error: String.error) + let validMaster = "5500000000000004" + + // when + let isValid = rule.validate(input: validMaster) + + // then + XCTAssertTrue(isValid) + } + + func test_validate_masterCardInvalid_shouldReturnFalse() { + // given + let rule = CreditCardValidationRule(types: [.masterCard], error: String.error) + let invalidMaster = "550000000000" + + // when + let isValid = rule.validate(input: invalidMaster) + + // then + XCTAssertFalse(isValid) + } + + // MARK: - American Express + + func test_validate_amexValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.amex], error: String.error) + let validAmex = "340000000000009" + + // when + let isValid = rule.validate(input: validAmex) + + // then + XCTAssertTrue(isValid) + } + + func test_validate_amexInvalid_shouldReturnFalse() { + // given + let rule = CreditCardValidationRule(types: [.amex], error: String.error) + let invalidAmex = "3400000000000099" + + // when + let isValid = rule.validate(input: invalidAmex) + + // then + XCTAssertFalse(isValid) + } + + // MARK: - JCB + + func test_validate_jcbValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.jcb], error: String.error) + let validJCB = "3528000000000007" + + // when + let isValid = rule.validate(input: validJCB) + + // then + XCTAssertTrue(isValid) + } + + // MARK: - UnionPay + + func test_validate_unionPayValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.unionPay], error: String.error) + let validUnionPay = "6221260000000000" + + // when + let isValid = rule.validate(input: validUnionPay) + + // then + XCTAssertTrue(isValid) + } + + // MARK: - Multiple Types + + func test_validate_multipleTypesValid_shouldReturnTrue() { + // given + let rule = CreditCardValidationRule(types: [.visa, .amex, .masterCard], error: String.error) + let validVisa = "4111111111111111" + + // when + let isValid = rule.validate(input: validVisa) + + // then + XCTAssertTrue(isValid) + } + + // MARK: - Unknown Card Type + + func test_validate_unknownCardType_shouldReturnFalse() { + // given + let rule = CreditCardValidationRule(types: [.visa], error: String.error) + let randomCard = "9999999999999999" + + // when + let isValid = rule.validate(input: randomCard) + + // then + XCTAssertFalse(isValid) + } + + // MARK: - Empty Input + + func test_validate_emptyString_shouldReturnFalse() { + // given + let rule = CreditCardValidationRule(types: [.visa], error: String.error) + + // when + let isValid = rule.validate(input: "") + + // then + XCTAssertFalse(isValid) + } +} + +// MARK: Constants + +private extension String { + static let error = "Invalid card number" +} From e8600082096fea09e7d1f0c788169936e0dc9801 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 18 Nov 2025 23:28:34 +0400 Subject: [PATCH 08/10] chore(ci): add `conventional-pr.yml` for PR validation (#27) * chore(ci): add `conventional-pr.yml` for PR validation * chore: remove unused files * docs(changelog): update `CHANGELOG.md` --- .github/workflows/conventional-pr.yml | 20 +++ .../contents.xcworkspacedata | 7 - .../xcschemes/Validator-Package.xcscheme | 136 ------------------ .../xcschemes/ValidatorCore.xcscheme | 78 ---------- .../xcschemes/ValidatorUI.xcscheme | 78 ---------- CHANGELOG.md | 2 + 6 files changed, 22 insertions(+), 299 deletions(-) create mode 100644 .github/workflows/conventional-pr.yml delete mode 100644 .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/Validator-Package.xcscheme delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/ValidatorCore.xcscheme delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/ValidatorUI.xcscheme diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml new file mode 100644 index 0000000..ded67e7 --- /dev/null +++ b/.github/workflows/conventional-pr.yml @@ -0,0 +1,20 @@ +name: conventional-pr +on: + pull_request: + branches: + - main + - master + types: + - opened + - edited + - synchronize +jobs: + lint-pr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: amannn/action-semantic-pull-request@v6 + with: + requireScope: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Validator-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Validator-Package.xcscheme deleted file mode 100644 index ea021af..0000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Validator-Package.xcscheme +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorCore.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorCore.xcscheme deleted file mode 100644 index 57f8c0c..0000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorCore.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorUI.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorUI.xcscheme deleted file mode 100644 index ef67b36..0000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/ValidatorUI.xcscheme +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CHANGELOG.md b/CHANGELOG.md index 792f1e4..eb02336 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ All notable changes to this project will be documented in this file. - Added in Pull Request [#25](https://github.com/space-code/validator/pull/25). - Add `CreditCardValidationRule`. - Added in Pull Request [#26](https://github.com/space-code/validator/pull/26). +- Add `conventional-pr.yml` for PR validation. + - Added in Pull Request [#27](https://github.com/space-code/validator/pull/27). #### Updated - Update `Mintfile` From e68092f41c1ee5971d6234a46c0cd0d34ca11d6a Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 18 Nov 2025 23:32:09 +0400 Subject: [PATCH 09/10] chore(dependabot): update `dependabot.yml` (#28) * chore(dependabot): update `dependabot.yml` * docs(changelog): update `CHANGELOG.md` --- .github/dependabot.yml | 12 +++++++++++- CHANGELOG.md | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0bda337..b6621a9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,6 +16,11 @@ updates: - ns-vasilev reviewers: - ns-vasilev + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" - package-ecosystem: swift directory: / @@ -27,4 +32,9 @@ updates: assignees: - ns-vasilev reviewers: - - ns-vasilev \ No newline at end of file + - ns-vasilev + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index eb02336..c7f52c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,8 @@ All notable changes to this project will be documented in this file. #### Updated - Update `Mintfile` - Updated in Pull Request [#22](https://github.com/space-code/validator/pull/22). +- Update `dependabot.yml` + - Updated in Pull Request [#28](https://github.com/space-code/validator/pull/28). ## [1.2.0](https://github.com/space-code/validator/releases/tag/1.2.0) Released on 2025-11-13. From 3cc6744a68538368285a6d8e71ed4d8e274db186 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Wed, 19 Nov 2025 00:19:00 +0400 Subject: [PATCH 10/10] fix(ci): fix conventional commit script execution in GitHub Actions (#29) --- .github/workflows/conventional-pr.yml | 2 +- CHANGELOG.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conventional-pr.yml b/.github/workflows/conventional-pr.yml index ded67e7..75569d0 100644 --- a/.github/workflows/conventional-pr.yml +++ b/.github/workflows/conventional-pr.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - master + - dev types: - opened - edited diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f52c1..25248a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,10 @@ All notable changes to this project will be documented in this file. - Update `dependabot.yml` - Updated in Pull Request [#28](https://github.com/space-code/validator/pull/28). +#### Fixed +- Fix conventional commit script execution in GitHub Actions + - Fixed in Pull Request [#29](https://github.com/space-code/validator/pull/29). + ## [1.2.0](https://github.com/space-code/validator/releases/tag/1.2.0) Released on 2025-11-13.