Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip-ci] Add swiftlint format #5

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/SwiftLint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: SwiftLint on Changed Files

on: [pull_request]
on: push

jobs:
swiftlint:
Expand All @@ -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
Expand All @@ -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 '[email protected]'
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"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import dydxStateManager
import Abacus

public class dydxMarketInfoViewBuilder: NSObject, ObjectBuilderProtocol {
public func build<T>() -> T? {
public func build<T>() -> T? {
let presenter = dydxMarketInfoViewPresenter()
let view = presenter.viewModel?.createView() ?? PlatformViewModel().createView()
let viewController = dydxMarketInfoViewController(presenter: presenter, view: view, configuration: .nav)
Expand Down
Loading