From 303d0b2960622588989f8a0f15f6187591a1db6c Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:22:27 -0500 Subject: [PATCH 1/7] feat: Introduce SwiftLint configuration and a dedicated CI workflow, while updating the existing Swift CI and adding an `act` configuration. --- .github/workflows/lint.yml | 34 +++++++++++++++++++++++++ .github/workflows/swift.yml | 4 +-- .swiftlint.yml | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .swiftlint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..cabef4639 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,34 @@ +name: lint + +on: + push: + branches: [main] + paths: + - '**.swift' + - '.swiftlint.yml' + - '.github/workflows/lint.yml' + pull_request: + branches: [main] + paths: + - '**.swift' + - '.swiftlint.yml' + - '.github/workflows/lint.yml' + +jobs: + swiftlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install SwiftLint + run: | + SWIFTLINT_VERSION="0.56.2" + curl -sL "https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/swiftlint_linux.zip" -o swiftlint.zip + unzip -q swiftlint.zip + chmod +x swiftlint + sudo mv swiftlint /usr/local/bin/ + + - name: Run SwiftLint + run: | + swiftlint version + swiftlint lint --reporter github-actions-logging Sources/ Tests/ diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 8997890eb..53ba6a429 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -40,8 +40,8 @@ jobs: tar xzf swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz mv swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04 /opt/swift rm swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz - export PATH="/opt/swift/usr/bin:${PATH}" - - uses: actions/checkout@v2 + echo "/opt/swift/usr/bin" >> $GITHUB_PATH + - uses: actions/checkout@v4 - name: Build run: swift build -c ${{ matrix.kind }} -v - name: Install protobuf diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 000000000..6edcd6619 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,49 @@ +# SwiftLint Configuration for Fuzzilli +# https://github.com/realm/SwiftLint + +excluded: + - .build + - .venv + - v8 + - v8_patch + - Targets + - Package.swift + - "**/*.pb.swift" + +disabled_rules: + - trailing_whitespace + - line_length + - file_length + - type_body_length + - function_body_length + - cyclomatic_complexity + - identifier_name + - large_tuple + - nesting + - force_cast + - force_try + - force_unwrapping + - todo + - opening_brace + - trailing_comma + +opt_in_rules: + - empty_count + - empty_string + - fatal_error_message + - first_where + - overridden_super_call + - redundant_nil_coalescing + - sorted_first_last + - yoda_condition + - contains_over_first_not_nil + +function_parameter_count: + warning: 8 + error: 10 + +type_name: + min_length: 2 + max_length: 50 + +reporter: "github-actions-logging" From 395a75ded1b4041a23ee2fed9ac45789916c6dfe Mon Sep 17 00:00:00 2001 From: Oleg Lazari <111822913+oleglazari@users.noreply.github.com> Date: Sun, 4 Jan 2026 18:26:26 -0500 Subject: [PATCH 2/7] Enhance comment for ast.proto resource Updated comment to provide additional context about ast.proto. --- Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index a70109f56..0a4ceeef3 100755 --- a/Package.swift +++ b/Package.swift @@ -63,7 +63,7 @@ let package = Package( "Protobuf/README.md", "Protobuf/gen_programproto.py"], resources: [ - // The ast.proto file is required by the node.js parser + // The ast.proto file is required by the node.js parser and stuff .copy("Protobuf/ast.proto"), .copy("Compiler/Parser")]), From ef9f09d195e5bdab31b4e4f33eda65e4ef3f2b0b Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:30:55 -0500 Subject: [PATCH 3/7] added workflow_dispatch to force running on non-main branches --- .github/workflows/lint.yml | 1 + .github/workflows/swift.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cabef4639..cbd11fee8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,7 @@ name: lint on: + workflow_dispatch: # Manual trigger from GitHub UI push: branches: [main] paths: diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 53ba6a429..867def17f 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -1,6 +1,7 @@ name: build_test on: + workflow_dispatch: # Manual trigger from GitHub UI push: branches: [ main ] pull_request: From d6adaa9686c21bd29d9d11874c3c05797d73e72c Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:33:49 -0500 Subject: [PATCH 4/7] added wildcard for all branches linting --- .github/workflows/lint.yml | 2 +- .github/workflows/swift.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cbd11fee8..424ca6967 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,7 @@ name: lint on: workflow_dispatch: # Manual trigger from GitHub UI push: - branches: [main] + branches: ['**'] paths: - '**.swift' - '.swiftlint.yml' diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 867def17f..8b04769b7 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -3,7 +3,7 @@ name: build_test on: workflow_dispatch: # Manual trigger from GitHub UI push: - branches: [ main ] + branches: ['**'] pull_request: branches: [ main ] From 9bbf6bb971f1657e7604edf1a9007e5c0227552d Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:38:32 -0500 Subject: [PATCH 5/7] pivoted to not manually doing linting using marketplace --- .github/workflows/lint.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 424ca6967..67fdd946b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,15 +21,8 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install SwiftLint - run: | - SWIFTLINT_VERSION="0.56.2" - curl -sL "https://github.com/realm/SwiftLint/releases/download/${SWIFTLINT_VERSION}/swiftlint_linux.zip" -o swiftlint.zip - unzip -q swiftlint.zip - chmod +x swiftlint - sudo mv swiftlint /usr/local/bin/ - - - name: Run SwiftLint - run: | - swiftlint version - swiftlint lint --reporter github-actions-logging Sources/ Tests/ + - name: SwiftLint + uses: cirruslabs/swiftlint-action@v1 + with: + version: 0.56.2 + args: --reporter github-actions-logging From 01c496b379fdb0074f25d22277cd0a9eef75a5bc Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:42:13 -0500 Subject: [PATCH 6/7] chore: add .actrc for local CI simulation and update SwiftLint GitHub Action. --- .github/workflows/lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 67fdd946b..fff9d6d81 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,6 @@ jobs: - uses: actions/checkout@v4 - name: SwiftLint - uses: cirruslabs/swiftlint-action@v1 + uses: norio-nomura/action-swiftlint@3.2.1 with: - version: 0.56.2 args: --reporter github-actions-logging From 159975ef7db5537588cd9361385d21d658dad3dd Mon Sep 17 00:00:00 2001 From: Oleg Lazari Date: Sun, 4 Jan 2026 18:47:25 -0500 Subject: [PATCH 7/7] Added leniency for test files and such --- .github/workflows/lint.yml | 2 +- .swiftlint.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fff9d6d81..8cff89bc5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,4 +24,4 @@ jobs: - name: SwiftLint uses: norio-nomura/action-swiftlint@3.2.1 with: - args: --reporter github-actions-logging + args: --reporter github-actions-logging --lenient diff --git a/.swiftlint.yml b/.swiftlint.yml index 6edcd6619..c4c4bbd04 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -9,6 +9,7 @@ excluded: - Targets - Package.swift - "**/*.pb.swift" + - "**/*Test*" disabled_rules: - trailing_whitespace