Skip to content

Commit 61111f7

Browse files
Apply standard Swift package configuration (#15)
* Apply standard Swift package configuration * Use ssh key
1 parent 7292994 commit 61111f7

File tree

15 files changed

+577
-23
lines changed

15 files changed

+577
-23
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @tinder-cfuller

.github/workflows/docc.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: DocC
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
11+
12+
jobs:
13+
docc:
14+
name: DocC
15+
runs-on: macos-latest
16+
env:
17+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
18+
steps:
19+
- name: Add ssh key
20+
run: |
21+
mkdir -p ~/.ssh
22+
ssh-keyscan github.com >> ~/.ssh/known_hosts
23+
ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null
24+
ssh-add - <<< "${{ secrets.TINDER_GITHUB_SSH_KEY }}"
25+
- name: Checkout source
26+
uses: actions/checkout@v4
27+
- name: Build
28+
run: make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)"

.github/workflows/swift.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Swift
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
11+
12+
jobs:
13+
swift:
14+
name: Swift
15+
runs-on: macos-latest
16+
env:
17+
SIMULATOR: iPhone 15
18+
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
19+
steps:
20+
- name: Add ssh key
21+
run: |
22+
mkdir -p ~/.ssh
23+
ssh-keyscan github.com >> ~/.ssh/known_hosts
24+
ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null
25+
ssh-add - <<< "${{ secrets.TINDER_GITHUB_SSH_KEY }}"
26+
- name: Checkout source
27+
uses: actions/checkout@v4
28+
- name: Download swiftlint binary
29+
run: swift package resolve
30+
- name: Lint
31+
run: >
32+
"$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)"
33+
lint --strict --reporter github-actions-logging
34+
- name: Resolve package dependencies
35+
run: xcodebuild -resolvePackageDependencies
36+
- name: Build
37+
run: >
38+
xcodebuild
39+
build-for-testing
40+
-scheme "Nodes-Tree-Visualizer"
41+
-destination "name=$SIMULATOR,OS=latest"
42+
-skipPackagePluginValidation
43+
- name: Test
44+
run: >
45+
xcodebuild
46+
test-without-building
47+
-scheme "Nodes-Tree-Visualizer"
48+
-destination "name=$SIMULATOR,OS=latest"

.swiftlint-rules.yml

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
analyzer_rules:
2+
- capture_variable
3+
# - explicit_self
4+
- typesafe_array_init
5+
# - unused_declaration
6+
- unused_import
7+
8+
only_rules:
9+
- accessibility_label_for_image
10+
- accessibility_trait_for_button
11+
- anonymous_argument_in_multiline_closure
12+
- anyobject_protocol
13+
- array_init
14+
# - attributes
15+
- balanced_xctest_lifecycle
16+
- blanket_disable_command
17+
- block_based_kvo
18+
- class_delegate_protocol
19+
- closing_brace
20+
- closure_body_length
21+
- closure_end_indentation
22+
- closure_parameter_position
23+
- closure_spacing
24+
- collection_alignment
25+
- colon
26+
- comma
27+
- comma_inheritance
28+
- comment_spacing
29+
- compiler_protocol_init
30+
- computed_accessors_order
31+
- conditional_returns_on_newline
32+
- contains_over_filter_count
33+
- contains_over_filter_is_empty
34+
- contains_over_first_not_nil
35+
- contains_over_range_nil_comparison
36+
# - contrasted_opening_brace
37+
- control_statement
38+
- convenience_type
39+
- custom_rules
40+
- cyclomatic_complexity
41+
- deployment_target
42+
- direct_return
43+
- discarded_notification_center_observer
44+
- discouraged_assert
45+
- discouraged_direct_init
46+
- discouraged_none_name
47+
- discouraged_object_literal
48+
- discouraged_optional_boolean
49+
- discouraged_optional_collection
50+
- duplicate_conditions
51+
- duplicate_enum_cases
52+
- duplicate_imports
53+
- duplicated_key_in_dictionary_literal
54+
- dynamic_inline
55+
- empty_collection_literal
56+
- empty_count
57+
- empty_enum_arguments
58+
- empty_parameters
59+
- empty_parentheses_with_trailing_closure
60+
- empty_string
61+
- empty_xctest_method
62+
- enum_case_associated_values_count
63+
- expiring_todo
64+
- explicit_acl
65+
- explicit_enum_raw_value
66+
- explicit_init
67+
- explicit_top_level_acl
68+
- explicit_type_interface
69+
# - extension_access_modifier
70+
- fallthrough
71+
- fatal_error_message
72+
- file_header
73+
- file_length
74+
- file_name
75+
- file_name_no_space
76+
- file_types_order
77+
- final_test_case
78+
- first_where
79+
- flatmap_over_map_reduce
80+
- for_where
81+
- force_cast
82+
- force_try
83+
- force_unwrapping
84+
- function_body_length
85+
- function_default_parameter_at_end
86+
- function_parameter_count
87+
- generic_type_name
88+
- given_when_then # custom_rule
89+
- ibinspectable_in_extension
90+
- identical_operands
91+
- identifier_name
92+
- implicit_getter
93+
- implicit_return
94+
- implicitly_unwrapped_optional
95+
- inclusive_language
96+
# - indentation_width
97+
- inert_defer
98+
- invalid_swiftlint_command
99+
- is_disjoint
100+
- joined_default_parameter
101+
- large_tuple
102+
- last_where
103+
- leading_whitespace
104+
- legacy_cggeometry_functions
105+
- legacy_constant
106+
- legacy_constructor
107+
- legacy_hashing
108+
- legacy_multiple
109+
- legacy_nsgeometry_functions
110+
- legacy_objc_type
111+
- legacy_random
112+
- let_var_whitespace
113+
- line_length
114+
- literal_expression_end_indentation
115+
- local_doc_comment
116+
- lower_acl_than_parent
117+
- mark
118+
# - missing_docs
119+
- modifier_order
120+
- multiline_arguments
121+
# - multiline_arguments_brackets
122+
- multiline_function_chains
123+
- multiline_literal_brackets
124+
- multiline_parameters
125+
- multiline_parameters_brackets
126+
- multiple_closures_with_trailing_closure
127+
- nesting
128+
- nimble_operator
129+
# - no_empty_block
130+
- no_extension_access_modifier
131+
- no_fallthrough_only
132+
- no_grouping_extension
133+
# - no_magic_numbers
134+
- no_space_in_method_call
135+
- non_optional_string_data_conversion
136+
- non_overridable_class_declaration
137+
- notification_center_detachment
138+
- ns_number_init_as_function_reference
139+
- nslocalizedstring_key
140+
- nslocalizedstring_require_bundle
141+
- nsobject_prefer_isequal
142+
- number_separator
143+
# - object_literal
144+
# - one_declaration_per_file
145+
- opening_brace
146+
- operator_usage_whitespace
147+
- operator_whitespace
148+
- optional_enum_case_matching
149+
- orphaned_doc_comment
150+
- overridden_super_call
151+
- override_in_extension
152+
- pattern_matching_keywords
153+
- period_spacing
154+
- prefer_key_path
155+
- prefer_nimble
156+
- prefer_self_in_static_references
157+
- prefer_self_type_over_type_of_self
158+
- prefer_zero_over_explicit_init
159+
# - prefixed_toplevel_constant
160+
- private_action
161+
- private_outlet
162+
- private_over_fileprivate
163+
- private_subject
164+
- private_swiftui_state
165+
- private_unit_test
166+
- prohibited_interface_builder
167+
- prohibited_super_call
168+
- protocol_property_accessors_order
169+
- quick_discouraged_call
170+
- quick_discouraged_focused_test
171+
- quick_discouraged_pending_test
172+
- raw_value_for_camel_cased_codable_enum
173+
- reduce_boolean
174+
- reduce_into
175+
- redundant_discardable_let
176+
- redundant_nil_coalescing
177+
- redundant_objc_attribute
178+
- redundant_optional_initialization
179+
- redundant_self_in_closure
180+
- redundant_set_access_control
181+
# - redundant_string_enum_value
182+
- redundant_type_annotation
183+
- redundant_void_return
184+
# - required_deinit
185+
- required_enum_case
186+
- return_arrow_whitespace
187+
# - return_value_from_void_function
188+
- self_binding
189+
- self_in_property_initialization
190+
# - shorthand_argument
191+
- shorthand_operator
192+
- shorthand_optional_binding
193+
- single_test_class
194+
# - sorted_enum_cases
195+
- sorted_first_last
196+
- sorted_imports
197+
- statement_position
198+
- static_operator
199+
- static_over_final_class
200+
- strict_fileprivate
201+
- strong_iboutlet
202+
- superfluous_disable_command
203+
- superfluous_else
204+
- switch_case_alignment
205+
- switch_case_on_newline
206+
- syntactic_sugar
207+
- test_case_accessibility
208+
- todo
209+
- toggle_bool
210+
- trailing_closure
211+
- trailing_comma
212+
- trailing_newline
213+
- trailing_semicolon
214+
- trailing_whitespace
215+
- type_body_length
216+
- type_contents_order
217+
- type_name
218+
- unavailable_condition
219+
- unavailable_function
220+
- unhandled_throwing_task
221+
- unneeded_break_in_switch
222+
# - unneeded_override
223+
- unneeded_parentheses_in_closure_argument
224+
- unneeded_synthesized_initializer
225+
- unowned_variable_capture
226+
- untyped_error_in_catch
227+
- unused_capture_list
228+
- unused_closure_parameter
229+
- unused_control_flow_label
230+
- unused_enumerated
231+
- unused_optional_binding
232+
- unused_parameter
233+
- unused_setter_value
234+
- valid_ibinspectable
235+
- vertical_parameter_alignment
236+
- vertical_parameter_alignment_on_call
237+
- vertical_whitespace
238+
# - vertical_whitespace_between_cases
239+
# - vertical_whitespace_closing_braces
240+
# - vertical_whitespace_opening_braces
241+
- void_function_in_ternary
242+
- void_return
243+
- weak_delegate
244+
- xct_specific_matcher
245+
- xctfail_message
246+
- yoda_condition

.swiftlint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
included:
2+
- Sources
3+
- Tests
4+
5+
child_config: .swiftlint-rules.yml
6+
7+
empty_count:
8+
only_after_dot: true
9+
10+
file_header:
11+
required_pattern: |
12+
\/\/
13+
\/\/ {2}Copyright © \d{4} Tinder \(Match Group, LLC\)
14+
\/\/
15+
16+
private_over_fileprivate:
17+
validate_extensions: true
18+
19+
trailing_whitespace:
20+
ignores_comments: false
21+
22+
custom_rules:
23+
given_when_then:
24+
name: GIVEN / WHEN / THEN
25+
message: |
26+
"GIVEN / WHEN / THEN" comments must be uppercase, without punctuation and both preceded and followed by an empty line.
27+
regex: |
28+
((?<=\n) +\/\/ (Given|given|When|when|Then|then)(?= *\n))|((?<=\n) +[^ ]\/\/ (GIVEN|WHEN|THEN))|((?<=\n) +\/\/ +(GIVEN|WHEN|THEN))|((?<=[^\n]\n) +\/\/ (GIVEN|WHEN|THEN))|((?<=\n) +\/\/ (GIVEN|WHEN|THEN)(?!\n\n))

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
All release notes are available on [GitHub](https://github.com/Tinder/Nodes-Tree-Visualizer/releases).
4+
5+
Alternatively, use `git log <from-tag>...<to-tag>` to view changes locally.
6+
7+
**Example:**
8+
9+
```
10+
git log 0.0.1...0.0.2
11+
```

0 commit comments

Comments
 (0)