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

Linter error #27

Closed
wants to merge 19 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
23 changes: 20 additions & 3 deletions .github/workflows/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,37 @@ name: pr-workflow
on:
pull_request:
branches: [ "main" ]
paths:
- '.github/workflows/swiftlint.yml'
- '.swiftlint.yml'
- '**/*.swift'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
swiftLint:
runs-on: ubuntu-latest
container:
image: ghcr.io/realm/swiftlint:5.5-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install Git
run: |
apt-get update
apt-get install -y git

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Git status
run: |
git status

# Runs a single command using the runners shell
- name: SwiftLint
uses: norio-nomura/[email protected]
env:
DIFF_BASE: ${{ github.base_ref }}
run: |
sh ci_scripts/lint_changed_files.sh

Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ private struct ContentView: View {
}
}





@ViewBuilder
var errorsList: some View {
VStack(spacing: CGFloat(.mediumSpacing)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ struct StationRewardsTimelineView: View {
}
}







#Preview {
let range = 0..<7
let values = range.map { _ in Int.random(in: 0...100) }
Expand Down
5 changes: 5 additions & 0 deletions ci_scripts/lint_changed_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
pwd
changedFiles=$(git diff --name-only main..HEAD | grep '\.swift$')
echo $changedFiles
changedFiles | xargs -I% swiftlint lint --strict --quiet codeclimate "%" | sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 title=Lint error,file=\1,line=\2,col=\3::\5\n\1:\2:\3/'
6 changes: 3 additions & 3 deletions wxm-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -945,13 +945,13 @@
path = "Multiple Alerts";
sourceTree = "<group>";
};
2623FF8F2AF1467E00BCDAC6 /* Daily Rewards */ = {
2623FF8F2AF1467E00BCDAC6 /* Daily Rewards */ = {
isa = PBXGroup;
children = (
2623FF902AF147A800BCDAC6 /* RewardDetailsView.swift */,
2623FF922AF14B4E00BCDAC6 /* RewardDetailsViewModel.swift */,
);
path = "Daily Rewards ";
path = "Daily Rewards";
sourceTree = "<group>";
};
262A4CEA2A934F5D00A4BC17 /* Main Screen */ = {
Expand All @@ -968,7 +968,7 @@
children = (
268D07912B2B1B54002BD77E /* Select Station Location */,
262B03052B20BC5400C31FE7 /* App Update */,
2623FF8F2AF1467E00BCDAC6 /* Daily Rewards */,
2623FF8F2AF1467E00BCDAC6 /* Daily Rewards */,
26D47E9F2A1783D10078723A /* Analytics */,
26A4118F29BF1AFE00A2C10B /* Change Frequency */,
2675471529A9181E008BCF40 /* ClaimDevice */,
Expand Down
Loading