Skip to content

Commit 511706e

Browse files
ci: add swiftlint
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below. While a solution is not provided we will go forward with having this swiftlint action and disable the megalinter swiftlint process. oxsecurity/megalinter#440 Fixes ATL-1640
1 parent 1d42e95 commit 511706e

File tree

2 files changed

+95
-87
lines changed

2 files changed

+95
-87
lines changed

.github/workflows/megalinter.yml

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ jobs:
2222
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
2323
DISABLE: COPYPASTE,SPELL
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
DISABLE_LINTERS: SWIFT_SWIFTLINT
26+
27+
- name: SwiftLint
28+
uses: norio-nomura/[email protected]
29+
with:
30+
args: --strict
31+
env:
32+
DIFF_BASE: ${{ github.base_ref }}
2533

2634
- name: Archive production artifacts
2735
if: success() || failure()

.swiftlint.yml

+87-87
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
11
disabled_rules:
2-
- todo
3-
- colon
4-
- opening_brace
5-
- reduce_into
6-
- vertical_parameter_alignment_on_call
7-
- array_init
2+
- todo
3+
- colon
4+
- opening_brace
5+
- reduce_into
6+
- vertical_parameter_alignment_on_call
7+
- array_init
88
opt_in_rules:
9-
- force_unwrapping
10-
- force_cast
11-
- anyobject_protocol
12-
- array_init
13-
- closure_spacing
14-
- collection_alignment
15-
- contains_over_filter_count
16-
- contains_over_filter_is_empty
17-
- contains_over_first_not_nil
18-
- contains_over_range_nil_comparison
19-
- empty_collection_literal
20-
- empty_count
21-
- empty_string
22-
- empty_xctest_method
23-
- enum_case_associated_values_count
24-
- explicit_init
25-
- extension_access_modifier
26-
- fallthrough
27-
- fatal_error_message
28-
- file_header
29-
- flatmap_over_map_reduce
30-
- identical_operands
31-
- joined_default_parameter
32-
- last_where
33-
- legacy_multiple
34-
- legacy_random
35-
- literal_expression_end_indentation
36-
- lower_acl_than_parent
37-
- modifier_order
38-
- nimble_operator
39-
- nslocalizedstring_key
40-
- number_separator
41-
- operator_usage_whitespace
42-
- overridden_super_call
43-
- override_in_extension
44-
- pattern_matching_keywords
45-
- prefer_self_type_over_type_of_self
46-
- private_action
47-
- private_outlet
48-
- prohibited_interface_builder
49-
- prohibited_super_call
50-
- quick_discouraged_call
51-
- quick_discouraged_focused_test
52-
- quick_discouraged_pending_test
53-
- reduce_into
54-
- redundant_nil_coalescing
55-
- redundant_type_annotation
56-
- single_test_class
57-
- sorted_first_last
58-
- sorted_imports
59-
- static_operator
60-
- strong_iboutlet
61-
- test_case_accessibility
62-
- toggle_bool
63-
- unavailable_function
64-
- unneeded_parentheses_in_closure_argument
65-
- unowned_variable_capture
66-
- untyped_error_in_catch
67-
- vertical_parameter_alignment_on_call
68-
- vertical_whitespace_closing_braces
69-
- vertical_whitespace_opening_braces
70-
- xct_specific_matcher
71-
- yoda_condition
9+
- force_unwrapping
10+
- force_cast
11+
- anyobject_protocol
12+
- array_init
13+
- closure_spacing
14+
- collection_alignment
15+
- contains_over_filter_count
16+
- contains_over_filter_is_empty
17+
- contains_over_first_not_nil
18+
- contains_over_range_nil_comparison
19+
- empty_collection_literal
20+
- empty_count
21+
- empty_string
22+
- empty_xctest_method
23+
- enum_case_associated_values_count
24+
- explicit_init
25+
- extension_access_modifier
26+
- fallthrough
27+
- fatal_error_message
28+
- file_header
29+
- flatmap_over_map_reduce
30+
- identical_operands
31+
- joined_default_parameter
32+
- last_where
33+
- legacy_multiple
34+
- legacy_random
35+
- literal_expression_end_indentation
36+
- lower_acl_than_parent
37+
- modifier_order
38+
- nimble_operator
39+
- nslocalizedstring_key
40+
- number_separator
41+
- operator_usage_whitespace
42+
- overridden_super_call
43+
- override_in_extension
44+
- pattern_matching_keywords
45+
- prefer_self_type_over_type_of_self
46+
- private_action
47+
- private_outlet
48+
- prohibited_interface_builder
49+
- prohibited_super_call
50+
- quick_discouraged_call
51+
- quick_discouraged_focused_test
52+
- quick_discouraged_pending_test
53+
- reduce_into
54+
- redundant_nil_coalescing
55+
- redundant_type_annotation
56+
- single_test_class
57+
- sorted_first_last
58+
- sorted_imports
59+
- static_operator
60+
- strong_iboutlet
61+
- test_case_accessibility
62+
- toggle_bool
63+
- unavailable_function
64+
- unneeded_parentheses_in_closure_argument
65+
- unowned_variable_capture
66+
- untyped_error_in_catch
67+
- vertical_parameter_alignment_on_call
68+
- vertical_whitespace_closing_braces
69+
- vertical_whitespace_opening_braces
70+
- xct_specific_matcher
71+
- yoda_condition
7272
excluded:
73-
- build
74-
- Pods
75-
- protobuf
76-
- PrismAPISDK
77-
- Sources/PrismSwiftSDK/protobuf
78-
- Tests/PrismSwiftSDKTests
73+
- build
74+
- Pods
75+
- protobuf
76+
- PrismAPISDK
77+
- Sources/PrismSwiftSDK/protobuf
78+
- Tests/PrismSwiftSDKTests
7979
line_length:
80-
ignores_comments: true
81-
ignores_urls: true
80+
ignores_comments: true
81+
ignores_urls: true
8282
function_body_length:
83-
warning: 100
84-
error: 200
83+
warning: 100
84+
error: 200
8585
type_body_length:
86-
warning: 350
87-
error: 700
86+
warning: 350
87+
error: 700
8888
file_length:
89-
ignore_comment_only_lines: true
89+
ignore_comment_only_lines: true
9090
cyclomatic_complexity:
91-
warning: 25
92-
error: 50
91+
warning: 25
92+
error: 50
9393
function_parameter_count:
94-
warning: 12
95-
error: 20
94+
warning: 12
95+
error: 20
9696
large_tuple:
9797
warning: 4
9898
error: 5
9999
nesting:
100100
type_level: 3
101101
identifier_name:
102-
max_length:
102+
max_length:
103103
warning: 40
104104
error: 100
105105
allowed_symbols: ["_"] # these are allowed in constants names

0 commit comments

Comments
 (0)