Skip to content

Commit 05021ce

Browse files
MBL-2782: Add swiftlint and run automatically with Danger (#2625)
1 parent 4883a6d commit 05021ce

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

.swiftlint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
disabled_rules:
2+
# It's OK to have a TODO across PRs.
3+
- todo
4+
# It's OK to have a force try.
5+
- force_try
6+
# These are all whitespace rules.
7+
# swiftformat handles all our whitespace.
8+
- line_length
9+
- colon
10+
- comma
11+
- comment_spacing
12+
13+
# Setting up swiftlint on 9/15/25.
14+
# We only want to catch future violations, so creating a baseline.
15+
baseline: swiftlint_baseline_09_15_2025.json
16+
17+
opt_in_rules:
18+
- closure_body_length
19+
20+
excluded:
21+
# GraphAPI is autogenerated
22+
- GraphAPI

Dangerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ warn("Big PR") if git.lines_of_code > 500
55
swiftformat.additional_message = "This PR violates our formatting conventions. Run ./bin/format.sh to fix."
66
swiftformat.binary_path = "bin/swiftformat"
77
swiftformat.additional_args = "--config .swiftformat --swiftversion 5"
8-
swiftformat.check_format(fail_on_error: true)
8+
swiftformat.check_format(fail_on_error: true)
9+
10+
# SwiftLint
11+
swiftlint.binary_path = "bin/swiftlint"
12+
swiftlint.config_file = ".swiftlint.yml"
13+
swiftlint.max_num_violations = 20
14+
swiftlint.lint_files

bin/swiftlint

37.3 MB
Binary file not shown.

swiftlint_baseline_09_15_2025.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)