Skip to content

Commit 60e8cde

Browse files
fboemerkarulontRuiyuZhuAkshay Wadiangenise
committed
Initial commit
Co-authored-by: Karl Tarbe <[email protected]> Co-authored-by: Ruiyu Zhu <[email protected]> Co-authored-by: Akshay Wadia <[email protected]> Co-authored-by: Nick Genise <[email protected]> Co-authored-by: Haris Mughees <[email protected]>
0 parents  commit 60e8cde

File tree

133 files changed

+25342
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+25342
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.xcuserdatad
2+
*.xcuserstate
3+
.DS_Store
4+
.benchmarkBaselines/
5+
.build/
6+
.docc-build/
7+
.swiftpm
8+
.vscode/
9+
xcuserdata/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "swift-homomorphic-encryption-protobuf"]
2+
path = swift-homomorphic-encryption-protobuf
3+
url = [email protected]:apple/swift-homomorphic-encryption-protobuf.git

.pre-commit-config.yaml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
repos:
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.6.0
18+
hooks:
19+
- id: check-case-conflict
20+
- id: check-merge-conflict
21+
- id: check-symlinks
22+
- id: fix-byte-order-marker
23+
- id: check-toml
24+
- id: check-yaml
25+
args: [--allow-multiple-documents]
26+
- id: end-of-file-fixer
27+
- id: mixed-line-ending
28+
- id: no-commit-to-branch
29+
args: [--branch, main]
30+
- id: trailing-whitespace
31+
- repo: https://github.com/crate-ci/typos
32+
rev: v1.23.1
33+
hooks:
34+
- id: typos
35+
- repo: https://github.com/Lucas-C/pre-commit-hooks
36+
rev: v1.5.5
37+
hooks:
38+
- id: insert-license
39+
name: insert-license
40+
'types_or': [c, swift, proto]
41+
args:
42+
- --license-filepath
43+
- copyright-header.txt
44+
- --comment-style
45+
- //
46+
- --allow-past-years
47+
- --use-current-year
48+
- --detect-license-in-X-top-lines=10
49+
- id: insert-license
50+
name: insert-license-yaml
51+
'types_or': [yaml]
52+
args:
53+
- --license-filepath
54+
- copyright-header.txt
55+
- --allow-past-years
56+
- --use-current-year
57+
- repo: local
58+
hooks:
59+
# https://github.com/nicklockwood/SwiftFormat
60+
- id: lockwood-swiftformat
61+
name: lockwood-swiftformat
62+
entry: swiftformat
63+
language: system
64+
types: [swift]
65+
# https://github.com/apple/swift-format
66+
- id: apple-swift-format
67+
name: apple-swift-format
68+
entry: ci/run-apple-swift-format.sh
69+
language: script
70+
pass_filenames: false
71+
# https://github.com/realm/SwiftLint
72+
- id: swiftlint
73+
name: swiftlint
74+
entry: swiftlint lint --strict
75+
language: system
76+
exclude: DoubleWidthUInt.swift|.pb.swift
77+
types: [swift]

.swift-format

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rules" : {
3+
"BeginDocumentationCommentWithOneLineSummary" : true,
4+
"UseTripleSlashForDocumentationComments" : true,
5+
"ValidateDocumentationComments" : true
6+
}
7+
}

.swiftformat

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--asynccapturing XCTAssertAsyncThrowsError
2+
--closingparen same-line
3+
--exclude **/*.pb.swift
4+
--extensionacl on-declarations
5+
--ifdef no-indent
6+
--indent 4
7+
--indentstrings true
8+
--maxwidth 120
9+
--nospaceoperators ..<, ...
10+
--ranges no-space
11+
--self init-only
12+
--swiftversion 5.8

.swiftlint.yml

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# Copyright 2024 Apple Inc. and the Swift Homomorphic Encryption project authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
disabled_rules:
16+
- cyclomatic_complexity
17+
- file_length
18+
- function_body_length
19+
- identifier_name
20+
- opening_brace # conflicts with swiftformat
21+
- todo
22+
- trailing_comma # conflicts with swiftformat
23+
- type_body_length
24+
- vertical_parameter_alignment_on_call # conflicts with swiftformat
25+
- file_header # pre-commit deals with license header
26+
- raw_value_for_camel_cased_codable_enum # conflicts with swiftformat
27+
- extension_access_modifier
28+
29+
excluded:
30+
- "**/*pb.swift"
31+
- "**/DoubleWidthUInt.swift"
32+
- "**/.build/"
33+
34+
line_length:
35+
warning: 120
36+
ignores_urls: true
37+
38+
closure_body_length:
39+
warning: 40
40+
41+
opt_in_rules:
42+
- accessibility_label_for_image
43+
- accessibility_trait_for_button
44+
- anonymous_argument_in_multiline_closure
45+
- array_init
46+
- attributes
47+
- balanced_xctest_lifecycle
48+
- closure_body_length
49+
- closure_end_indentation
50+
- closure_spacing
51+
- collection_alignment
52+
- comma_inheritance
53+
- conditional_returns_on_newline
54+
- contains_over_filter_count
55+
- contains_over_filter_is_empty
56+
- contains_over_first_not_nil
57+
- contains_over_range_nil_comparison
58+
- convenience_type
59+
- direct_return
60+
- discarded_notification_center_observer
61+
- discouraged_assert
62+
- discouraged_none_name
63+
- discouraged_object_literal
64+
- discouraged_optional_boolean
65+
- empty_collection_literal
66+
- empty_count
67+
- empty_string
68+
- empty_xctest_method
69+
- enum_case_associated_values_count
70+
- expiring_todo
71+
- explicit_init
72+
- fallthrough
73+
- fatal_error_message
74+
- file_name_no_space
75+
- first_where
76+
- flatmap_over_map_reduce
77+
- for_where
78+
- force_unwrapping
79+
- function_default_parameter_at_end
80+
- ibinspectable_in_extension
81+
- identical_operands
82+
- implicit_return
83+
- implicitly_unwrapped_optional
84+
- joined_default_parameter
85+
- large_tuple
86+
- last_where
87+
- legacy_multiple
88+
- literal_expression_end_indentation
89+
- local_doc_comment
90+
- lower_acl_than_parent
91+
- missing_docs
92+
- modifier_order
93+
- nimble_operator
94+
- nslocalizedstring_key
95+
- nslocalizedstring_require_bundle
96+
- object_literal
97+
- opening_brace
98+
- operator_usage_whitespace
99+
- optional_enum_case_matching
100+
- overridden_super_call
101+
- override_in_extension
102+
- pattern_matching_keywords
103+
- period_spacing
104+
- prefer_self_type_over_type_of_self
105+
- prefer_zero_over_explicit_init
106+
- private_action
107+
- private_outlet
108+
- private_subject
109+
- prohibited_interface_builder
110+
- prohibited_super_call
111+
- quick_discouraged_call
112+
- quick_discouraged_focused_test
113+
- quick_discouraged_pending_test
114+
- reduce_into
115+
- redundant_nil_coalescing
116+
- redundant_self_in_closure
117+
- redundant_type_annotation
118+
- required_enum_case
119+
- return_value_from_void_function
120+
- self_binding
121+
- shorthand_optional_binding
122+
- single_test_class
123+
- sorted_enum_cases
124+
- sorted_first_last
125+
- sorted_imports
126+
- static_operator
127+
- strict_fileprivate
128+
- strong_iboutlet
129+
- superfluous_else
130+
- test_case_accessibility
131+
- toggle_bool
132+
- trailing_closure
133+
- type_contents_order
134+
- unavailable_function
135+
- unhandled_throwing_task
136+
- unneeded_parentheses_in_closure_argument
137+
- unowned_variable_capture
138+
- untyped_error_in_catch
139+
- vertical_whitespace_closing_braces
140+
- vertical_whitespace_opening_braces
141+
- weak_delegate
142+
- xct_specific_matcher
143+
- yoda_condition
144+
145+
# Disabled rules
146+
# Deprecated or requires running analyzer
147+
# - anyobject_protocol
148+
# - capture_variable
149+
# - explicit_self
150+
# - inert_defer
151+
# - typesafe_array_init
152+
# - unused_capture_list
153+
# - unused_declaration
154+
# - unused_import
155+
156+
# Don't enable due to preference
157+
# - cyclomatic_complexity
158+
# - discouraged_optional_collection
159+
# - explicit_acl
160+
# - explicit_enum_raw_value
161+
# - explicit_top_level_acl
162+
# - explicit_type_interface
163+
# - extension_access_modifier
164+
# - file_length
165+
# - file_name
166+
# - file_types_order
167+
# - function_body_length
168+
# - identifier_name
169+
# - let_var_whitespace
170+
# - multiline_arguments
171+
# - multiline_arguments_brackets
172+
# - multiline_function_chains
173+
# - multiline_literal_brackets
174+
# - multiline_parameters
175+
# - multiline_parameters_brackets
176+
# - no_extension_access_modifier
177+
# - no_grouping_extension
178+
# - no_magic_numbers
179+
# - prefer_nimble
180+
# - prefer_self_in_static_references
181+
# - prefixed_toplevel_constant
182+
# - required_deinit
183+
# - switch_case_on_newline
184+
# - trailing_closure
185+
# - type_body_length
186+
# - vertical_whitespace_between_cases
187+
188+
# Don't enable due to swiftformat conflict, or it's required
189+
# - indentation_width
190+
# - legacy_objc_type
191+
# - number_separator
192+
# - opening_brace
193+
# - trailing_comma

0 commit comments

Comments
 (0)