Skip to content

Commit d8c8365

Browse files
authored
Improve linting (#243)
* Improve linting * Update copy_license script to ignore identation * Revert internal identifier
1 parent 492fb4a commit d8c8365

File tree

9 files changed

+945
-737
lines changed

9 files changed

+945
-737
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

27-
- run: ./scripts/copy_license && git diff --name-only --exit-code
27+
- run: ./scripts/copy_license --check
2828

2929
check-packed-files:
3030
name: Check package files

.swiftformat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--indent 4
2+
--linebreaks lf
3+
--wraparguments before-first
4+
--wrapcollections before-first
5+
--commas inline
6+
--allman false
7+
--semicolons inline
8+
--trimwhitespace always
9+
--disable redundantReturn,hoistAwait,preferKeyPath,redundantInternal,redundantPublic
10+
--swiftversion 5.7.1
11+
--extensionacl on-declarations

modules/@shopify/checkout-sheet-kit/.swiftlint.yml renamed to .swiftlint.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
disabled_rules:
22
- line_length
3-
- redundant_void_return
4-
- todo
5-
- switch_case_alignment
3+
- file_length
4+
- non_optional_string_data_conversion
5+
- type_body_length
6+
- type_name
7+
- identifier_name
8+
- opening_brace
69
- function_body_length
10+
- trailing_comma
711

812
opt_in_rules:
913
- array_init
@@ -22,6 +26,10 @@ opt_in_rules:
2226
- modifier_order
2327
- overridden_super_call
2428
- toggle_bool
29+
- switch_case_alignment:
30+
indented_cases: false
31+
- fallthrough
32+
- explicit_acl
2533

2634
nesting:
2735
type_level:

dev.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ up:
2626
packages:
2727
- xcode
2828

29+
check:
30+
lint: ./scripts/lint_swift
31+
2932
commands:
3033

3134
server:
@@ -47,3 +50,8 @@ commands:
4750
yarn module clean
4851
yarn sample clean
4952
echo "✅ Cleaned root, module and sample workspaces"
53+
54+
fix:
55+
desc: Fix linting
56+
run: |
57+
./scripts/lint_swift fix

0 commit comments

Comments
 (0)