diff --git a/.github/workflows/SwiftLint.yml b/.github/workflows/SwiftLint.yml index f1637c99..db8d43f2 100644 --- a/.github/workflows/SwiftLint.yml +++ b/.github/workflows/SwiftLint.yml @@ -1,6 +1,6 @@ name: SwiftLint on Changed Files -on: [pull_request] +on: push jobs: swiftlint: @@ -17,7 +17,7 @@ jobs: id: changes # Set outputs using the command. run: | - echo "::set-output name=all::$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)" + echo "::set-output name=all::$(git diff --name-only --diff-filter=AM ${{ github.event.before }} ${{ github.sha }} | xargs)" - name: Install SwiftLint run: brew install swiftlint @@ -39,5 +39,15 @@ jobs: echo "No Swift files to lint." else echo "Linting changed Swift files..." - swiftlint --config dydx/.swiftlint.yml --fix lint -- $SWIFT_FILES + swiftlint --config dydx/.swiftlint.yml --fix --format lint -- $SWIFT_FILES fi + + - name: Commit and push if needed + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name 'github-actions' + git config --global user.email 'github-actions@github.com' + git add . + git commit -m "Apply SwiftLint fixes" || true # Commit if there are changes; do nothing if there are none + git push || echo "No changes to push" diff --git a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift index eb1e1db9..b92d6ee1 100644 --- a/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift +++ b/dydx/dydxPresenters/dydxPresenters/_v4/MarketInfo/dydxMarketInfoViewBuilder.swift @@ -16,7 +16,7 @@ import dydxStateManager import Abacus public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol { - public func build() -> T? { + public func build() -> T? { let presenter = dydxMarketInfoViewPresenter() let view = presenter.viewModel?.createView() ?? PlatformViewModel().createView() let viewController = dydxMarketInfoViewController(presenter: presenter, view: view, configuration: .nav)