xref: /expo/.swiftlint.yml (revision 66575f0b)
1bf645134STomasz Sapeta# See all available rules: https://realm.github.io/SwiftLint/rule-directory.html
2bf645134STomasz Sapeta
3aab54672STomasz Sapeta# Don't use `included` parameter even though we'd like to limit which paths should be linted.
4aab54672STomasz Sapeta# When it's set, all paths passed as arguments to the command are ignored.
5aab54672STomasz Sapeta
6aab54672STomasz Sapeta# SwiftLint by default isn't efficient in excluding, `--use-alternative-excluding` flag makes it faster.
7aab54672STomasz Sapetaexcluded:
8aab54672STomasz Sapeta  - .direnv
9aab54672STomasz Sapeta  - android
10aab54672STomasz Sapeta  - apps
11aab54672STomasz Sapeta  - bin
12aab54672STomasz Sapeta  - docs
13aab54672STomasz Sapeta  - exponent-view-template
14aab54672STomasz Sapeta  - fastlane
15aab54672STomasz Sapeta  - guides
16aab54672STomasz Sapeta  - home
17aab54672STomasz Sapeta  - ios/Pods
18aab54672STomasz Sapeta  - ios/vendored
19aab54672STomasz Sapeta  - ios/versioned
20aab54672STomasz Sapeta  - ios/versioned-react-native
21aab54672STomasz Sapeta  - node_modules
22aab54672STomasz Sapeta  - packages/*/ios/Tests
23aab54672STomasz Sapeta  - packages/*/ios/UITests
24aab54672STomasz Sapeta  - packages/expo-module-template
25ab91dd02Saleqsio  - packages/expo-module-template-local
26e870aeeeSŁukasz Kosmaty  - packages/expo-dev-menu/ios/OverlayContainer
27aab54672STomasz Sapeta  - react-native-lab
28aab54672STomasz Sapeta  - scripts
29aab54672STomasz Sapeta  - secrets
30aab54672STomasz Sapeta  - template-files
31aab54672STomasz Sapeta  - tools
32bf645134STomasz Sapeta
33bf645134STomasz Sapeta# Enable rules that are turned off by default. Run `swiftlint rules` to see what's available to opt-in.
34bf645134STomasz Sapetaopt_in_rules:
35bf645134STomasz Sapeta  - anyobject_protocol
36998b32a0STomasz Sapeta  - array_init
37998b32a0STomasz Sapeta  - closure_body_length
38bf645134STomasz Sapeta  - closure_end_indentation
39bf645134STomasz Sapeta  - closure_spacing
40bf645134STomasz Sapeta  - collection_alignment
41998b32a0STomasz Sapeta  - comma_inheritance
42bf645134STomasz Sapeta  - conditional_returns_on_newline
43*66575f0bSTomasz Sapeta  - direct_return
44998b32a0STomasz Sapeta  - discouraged_object_literal
45bf645134STomasz Sapeta  - empty_collection_literal
46bf645134STomasz Sapeta  - empty_count
47bf645134STomasz Sapeta  - empty_string
48998b32a0STomasz Sapeta  - enum_case_associated_values_count
49998b32a0STomasz Sapeta  - fatal_error_message
50998b32a0STomasz Sapeta  - file_name_no_space
51998b32a0STomasz Sapeta  - force_unwrapping
52998b32a0STomasz Sapeta  - identical_operands
53998b32a0STomasz Sapeta  - implicitly_unwrapped_optional
54998b32a0STomasz Sapeta  - indentation_width
55998b32a0STomasz Sapeta  - legacy_objc_type
56998b32a0STomasz Sapeta  - literal_expression_end_indentation
57998b32a0STomasz Sapeta  - local_doc_comment
58998b32a0STomasz Sapeta  - lower_acl_than_parent
59998b32a0STomasz Sapeta  - multiline_arguments
60998b32a0STomasz Sapeta  - multiline_function_chains
61bf645134STomasz Sapeta  - multiline_literal_brackets
62bf645134STomasz Sapeta  - multiline_parameters
63bf645134STomasz Sapeta  - multiline_parameters_brackets
64998b32a0STomasz Sapeta  - no_grouping_extension
65bf645134STomasz Sapeta  - number_separator
66998b32a0STomasz Sapeta  - operator_usage_whitespace
67998b32a0STomasz Sapeta  - overridden_super_call
68bf645134STomasz Sapeta  - prefer_zero_over_explicit_init
69998b32a0STomasz Sapeta  - prohibited_super_call
70bf645134STomasz Sapeta  - redundant_nil_coalescing
71998b32a0STomasz Sapeta  - static_operator
72*66575f0bSTomasz Sapeta  - superfluous_else
73998b32a0STomasz Sapeta  - unavailable_function
74bf645134STomasz Sapeta  - unneeded_parentheses_in_closure_argument
75bf645134STomasz Sapeta  - unowned_variable_capture
76*66575f0bSTomasz Sapeta  - unused_capture_list
77bf645134STomasz Sapeta  - vertical_parameter_alignment_on_call
78bf645134STomasz Sapeta  - vertical_whitespace_closing_braces
79bf645134STomasz Sapeta  - vertical_whitespace_opening_braces
80bf645134STomasz Sapeta  - yoda_condition
81bf645134STomasz Sapeta
82bf645134STomasz Sapeta# Disable some rules that are turned on by default.
83bf645134STomasz Sapetadisabled_rules:
84bf645134STomasz Sapeta  - reduce_boolean
85bf645134STomasz Sapeta  - todo
86bf645134STomasz Sapeta  - weak_delegate
87bf645134STomasz Sapeta
88*66575f0bSTomasz Sapeta# Rules run by `swiftlint analyze`.
89*66575f0bSTomasz Sapetaanalyzer_rules:
90*66575f0bSTomasz Sapeta  - capture_variable
91*66575f0bSTomasz Sapeta  - unused_declaration
92*66575f0bSTomasz Sapeta  - unused_import
93*66575f0bSTomasz Sapeta
94bf645134STomasz Sapeta# Prefer using AnyObject over class for class-only protocols.
95bf645134STomasz Sapetaanyobject_protocol: warning
96bf645134STomasz Sapeta
97998b32a0STomasz Sapeta# Prefer using `Array(seq)` over `seq.map { $0 }` to convert a sequence into an Array.
98998b32a0STomasz Sapetaarray_init: warning
99998b32a0STomasz Sapeta
100998b32a0STomasz Sapeta# Non-constant variables should not be listed in a closure’s capture list
101998b32a0STomasz Sapeta# to avoid confusion about closures capturing variables at creation time.
102998b32a0STomasz Sapetacapture_variable: warning
103998b32a0STomasz Sapeta
104998b32a0STomasz Sapeta# Closure bodies should not span too many lines.
105998b32a0STomasz Sapetaclosure_body_length:
106998b32a0STomasz Sapeta  warning: 30
107998b32a0STomasz Sapeta  error: 50
108998b32a0STomasz Sapeta
109bf645134STomasz Sapeta# Closure end should have the same indentation as the line that started it.
110bf645134STomasz Sapetaclosure_end_indentation: warning
111bf645134STomasz Sapeta
112bf645134STomasz Sapeta# Closure expressions should have a single space inside each brace.
113bf645134STomasz Sapetaclosure_spacing: warning
114bf645134STomasz Sapeta
115bf645134STomasz Sapeta# All elements in a collection literal should be vertically aligned.
116bf645134STomasz Sapetacollection_alignment:
117bf645134STomasz Sapeta  severity: warning
118bf645134STomasz Sapeta  align_colons: false
119bf645134STomasz Sapeta
120998b32a0STomasz Sapeta# Use commas to separate types in inheritance lists.
121998b32a0STomasz Sapetacomma_inheritance: warning
122998b32a0STomasz Sapeta
123bf645134STomasz Sapeta# if, for, guard, switch, while, and catch statements shouldn’t unnecessarily wrap their conditionals or arguments in parentheses.
124bf645134STomasz Sapetacontrol_statement: warning
125bf645134STomasz Sapeta
126bf645134STomasz Sapeta# Limits the complexity of function bodies.
127bf645134STomasz Sapetacyclomatic_complexity:
128bf645134STomasz Sapeta  warning: 12
129bf645134STomasz Sapeta  error: 20
130bf645134STomasz Sapeta  ignores_case_statements: true
131bf645134STomasz Sapeta
132*66575f0bSTomasz Sapeta# Directly return the expression instead of assigning it to a variable first.
133*66575f0bSTomasz Sapetadirect_return: warning
134*66575f0bSTomasz Sapeta
135998b32a0STomasz Sapeta# Prefer initializers over object literals.
136998b32a0STomasz Sapetadiscouraged_object_literal:
137998b32a0STomasz Sapeta  severity: error
138998b32a0STomasz Sapeta  image_literal: true
139998b32a0STomasz Sapeta  color_literal: true
140998b32a0STomasz Sapeta
141bf645134STomasz Sapeta# Prefer checking `isEmpty` over comparing collection to an empty array or dictionary literal.
142bf645134STomasz Sapetaempty_collection_literal: warning
143bf645134STomasz Sapeta
144bf645134STomasz Sapeta# Prefer checking `isEmpty` over comparing count to zero.
145bf645134STomasz Sapetaempty_count:
146bf645134STomasz Sapeta  severity: warning
147bf645134STomasz Sapeta  only_after_dot: true
148bf645134STomasz Sapeta
149bf645134STomasz Sapeta# When using trailing closures, empty parentheses should be avoided after the method call.
150bf645134STomasz Sapetaempty_parentheses_with_trailing_closure: warning
151bf645134STomasz Sapeta
152bf645134STomasz Sapeta# Prefer checking `isEmpty` over comparing string to an empty string literal.
153bf645134STomasz Sapetaempty_string: warning
154bf645134STomasz Sapeta
155998b32a0STomasz Sapeta# Number of associated values in an enum case should be low.
156998b32a0STomasz Sapetaenum_case_associated_values_count:
157998b32a0STomasz Sapeta  warning: 5
158998b32a0STomasz Sapeta  error: 6
159998b32a0STomasz Sapeta
160998b32a0STomasz Sapeta# A `fatalError` call should have a message.
161998b32a0STomasz Sapetafatal_error_message: error
162998b32a0STomasz Sapeta
163*66575f0bSTomasz Sapeta# Files should not span too many lines.
164*66575f0bSTomasz Sapetafile_length:
165*66575f0bSTomasz Sapeta  warning: 850
166*66575f0bSTomasz Sapeta  error: 900
167*66575f0bSTomasz Sapeta  ignore_comment_only_lines: true
168*66575f0bSTomasz Sapeta
169998b32a0STomasz Sapeta# File name should not contain any whitespace.
170998b32a0STomasz Sapetafile_name_no_space:
171998b32a0STomasz Sapeta  severity: error
172998b32a0STomasz Sapeta
173998b32a0STomasz Sapeta# Force casts should be avoided.
174998b32a0STomasz Sapetaforce_cast: error
175998b32a0STomasz Sapeta
176998b32a0STomasz Sapeta# Force tries should be avoided.
177998b32a0STomasz Sapetaforce_try: error
178998b32a0STomasz Sapeta
179998b32a0STomasz Sapeta# Force unwrapping should be avoided.
180998b32a0STomasz Sapetaforce_unwrapping: error
181998b32a0STomasz Sapeta
182bf645134STomasz Sapeta# Functions bodies should not span too many lines.
183bf645134STomasz Sapetafunction_body_length:
184*66575f0bSTomasz Sapeta  warning: 250
185*66575f0bSTomasz Sapeta  error: 300
186bf645134STomasz Sapeta
187998b32a0STomasz Sapeta# Comparing two identical operands is likely a mistake.
188998b32a0STomasz Sapetaidentical_operands: error
189998b32a0STomasz Sapeta
190bf645134STomasz Sapeta# Identifier names should only contain alphanumeric characters and start with a lowercase character or should only
191bf645134STomasz Sapeta# contain capital letters. In an exception to the above, variable names may start with a capital letter when they are
192bf645134STomasz Sapeta# declared static and immutable. Variable names should not be too long or too short.
193bf645134STomasz Sapetaidentifier_name:
194bf645134STomasz Sapeta  min_length: 1
195bf645134STomasz Sapeta  max_length:
196bf645134STomasz Sapeta    warning: 35
197bf645134STomasz Sapeta    error: 50
198*66575f0bSTomasz Sapeta  validates_start_with_lowercase: warning
199f657683dSTomasz Sapeta  # Ignore Sweet API components as they intentionally start with the uppercase letter.
200f657683dSTomasz Sapeta  allowed_symbols:
201f657683dSTomasz Sapeta    [
202f657683dSTomasz Sapeta      '_',
203f657683dSTomasz Sapeta      'AsyncFunction',
204f657683dSTomasz Sapeta      'Class',
205f657683dSTomasz Sapeta      'Constants',
206f657683dSTomasz Sapeta      'Constructor',
207f657683dSTomasz Sapeta      'Events',
208f657683dSTomasz Sapeta      'Function',
209f657683dSTomasz Sapeta      'Name',
210f657683dSTomasz Sapeta      'OnAppBecomesActive',
211f657683dSTomasz Sapeta      'OnAppContextDestroys',
212f657683dSTomasz Sapeta      'OnAppEntersBackground',
213f657683dSTomasz Sapeta      'OnAppEntersForeground',
214f657683dSTomasz Sapeta      'OnCreate',
215f657683dSTomasz Sapeta      'OnDestroy',
216f657683dSTomasz Sapeta      'OnStartObserving',
217f657683dSTomasz Sapeta      'OnStopObserving',
218f657683dSTomasz Sapeta      'Prop',
219f657683dSTomasz Sapeta      'Property',
220f657683dSTomasz Sapeta      'View',
221f657683dSTomasz Sapeta      'ViewManager',
222f657683dSTomasz Sapeta    ]
223bf645134STomasz Sapeta
224998b32a0STomasz Sapeta# Implicitly unwrapped optionals should be avoided when possible.
225998b32a0STomasz Sapetaimplicitly_unwrapped_optional:
226998b32a0STomasz Sapeta  severity: error
227998b32a0STomasz Sapeta
228998b32a0STomasz Sapeta# Indent code using either one tab or the configured amount of spaces,
229998b32a0STomasz Sapeta# unindent to match previous indentations. Don’t indent the first line.
230998b32a0STomasz Sapetaindentation_width:
231998b32a0STomasz Sapeta  severity: warning
232998b32a0STomasz Sapeta  indentation_width: 2
233998b32a0STomasz Sapeta  include_comments: false
234*66575f0bSTomasz Sapeta  include_compiler_directives: false
235*66575f0bSTomasz Sapeta  include_multiline_strings: true
236998b32a0STomasz Sapeta
237998b32a0STomasz Sapeta# Tuples shouldn’t have too many members. Create a custom type instead.
238998b32a0STomasz Sapetalarge_tuple:
239998b32a0STomasz Sapeta  warning: 10
240998b32a0STomasz Sapeta  error: 10
241998b32a0STomasz Sapeta
242bf645134STomasz Sapeta# Files should not contain leading whitespace.
243bf645134STomasz Sapetaleading_whitespace: warning
244bf645134STomasz Sapeta
245bf645134STomasz Sapeta# Struct-scoped constants are preferred over legacy global constants.
246bf645134STomasz Sapetalegacy_constant: warning
247bf645134STomasz Sapeta
248bf645134STomasz Sapeta# Swift constructors are preferred over legacy convenience functions.
249bf645134STomasz Sapetalegacy_constructor: warning
250bf645134STomasz Sapeta
251998b32a0STomasz Sapeta# Prefer Swift value types to bridged Objective-C reference types.
252998b32a0STomasz Sapetalegacy_objc_type: warning
253998b32a0STomasz Sapeta
254bf645134STomasz Sapeta# Lines should not span too many characters.
255bf645134STomasz Sapetaline_length:
256bf645134STomasz Sapeta  warning: 160
257bf645134STomasz Sapeta  error: 200
258bf645134STomasz Sapeta  ignores_urls: true
259bf645134STomasz Sapeta  ignores_function_declarations: false
260bf645134STomasz Sapeta  ignores_comments: false
261bf645134STomasz Sapeta  ignores_interpolated_strings: true
262bf645134STomasz Sapeta
263998b32a0STomasz Sapeta# Array and dictionary literal end should have the same indentation as the line that started it.
264998b32a0STomasz Sapetaliteral_expression_end_indentation: warning
265998b32a0STomasz Sapeta
266998b32a0STomasz Sapeta# Doc comments shouldn’t be used in local scopes. Use regular comments.
267998b32a0STomasz Sapetalocal_doc_comment: warning
268998b32a0STomasz Sapeta
269998b32a0STomasz Sapeta# Ensure declarations have a lower access control level than their enclosing parent.
270998b32a0STomasz Sapetalower_acl_than_parent: warning
271998b32a0STomasz Sapeta
272bf645134STomasz Sapeta# MARK comment should be in valid format. e.g. `// MARK: ...` or `// MARK: - ...`
273bf645134STomasz Sapetamark: warning
274bf645134STomasz Sapeta
275998b32a0STomasz Sapeta# Arguments should be either on the same line, or one per line.
276998b32a0STomasz Sapetamultiline_arguments:
277998b32a0STomasz Sapeta  severity: warning
278998b32a0STomasz Sapeta
279998b32a0STomasz Sapeta# Chained function calls should be either on the same line, or one per line.
280998b32a0STomasz Sapetamultiline_function_chains: warning
281998b32a0STomasz Sapeta
282bf645134STomasz Sapeta# Multiline literals should have their surrounding brackets in a new line.
283bf645134STomasz Sapetamultiline_literal_brackets: warning
284bf645134STomasz Sapeta
285bf645134STomasz Sapeta# Functions and methods parameters should be either on the same line, or one per line.
286aab54672STomasz Sapetamultiline_parameters:
287aab54672STomasz Sapeta  severity: warning
288bf645134STomasz Sapeta
289f657683dSTomasz Sapeta# Types should be nested at most 1 level deep, and functions should be nested at most 2 levels deep.
290f657683dSTomasz Sapetanesting:
291f657683dSTomasz Sapeta  type_level: 1
292f657683dSTomasz Sapeta  function_level: 2
293f657683dSTomasz Sapeta
294bf645134STomasz Sapeta# Multiline parameters should have their surrounding brackets in a new line.
295bf645134STomasz Sapetamultiline_parameters_brackets: warning
296bf645134STomasz Sapeta
297998b32a0STomasz Sapeta# Extensions shouldn’t be used to group code within the same source file.
298998b32a0STomasz Sapetano_grouping_extension: warning
299998b32a0STomasz Sapeta
300bf645134STomasz Sapeta# Underscores should be used as thousand separator in large decimal numbers.
301bf645134STomasz Sapetanumber_separator:
302bf645134STomasz Sapeta  severity: warning
303b975e3faSTomasz Sapeta  minimum_length: 5
304bf645134STomasz Sapeta
305998b32a0STomasz Sapeta# Operators should be surrounded by a single whitespace when they are being used.
306998b32a0STomasz Sapetaoperator_usage_whitespace:
307998b32a0STomasz Sapeta  severity: warning
308998b32a0STomasz Sapeta
309bf645134STomasz Sapeta# A doc comment should be attached to a declaration.
310bf645134STomasz Sapetaorphaned_doc_comment: warning
311bf645134STomasz Sapeta
312998b32a0STomasz Sapeta# Some overridden methods should always call super.
313998b32a0STomasz Sapetaoverridden_super_call:
314998b32a0STomasz Sapeta  severity: warning
315998b32a0STomasz Sapeta
316bf645134STomasz Sapeta# Prefer `.zero` over explicit init with zero parameters (e.g. `CGPoint(x: 0, y: 0)`).
317bf645134STomasz Sapetaprefer_zero_over_explicit_init: warning
318bf645134STomasz Sapeta
319998b32a0STomasz Sapeta# Some methods should not call super.
320998b32a0STomasz Sapetaprohibited_super_call:
321998b32a0STomasz Sapeta  severity: warning
322998b32a0STomasz Sapeta
323bf645134STomasz Sapeta# When declaring properties in protocols, the order of accessors should be `get set`.
324bf645134STomasz Sapetaprotocol_property_accessors_order: warning
325bf645134STomasz Sapeta
326bf645134STomasz Sapeta# nil coalescing operator is only evaluated if the lhs is nil, coalescing operator with nil as rhs is redundant.
327bf645134STomasz Sapetaredundant_nil_coalescing: warning
328bf645134STomasz Sapeta
329bf645134STomasz Sapeta# Initializing an optional variable with nil is redundant.
330bf645134STomasz Sapetaredundant_optional_initialization: warning
331bf645134STomasz Sapeta
332998b32a0STomasz Sapeta# Operators should be declared as static functions, not free functions.
333998b32a0STomasz Sapetastatic_operator: warning
334998b32a0STomasz Sapeta
335*66575f0bSTomasz Sapeta# Else branches should be avoided when the previous if-block exits the current scope.
336*66575f0bSTomasz Sapetasuperfluous_else: warning
337*66575f0bSTomasz Sapeta
338bf645134STomasz Sapeta# Files should have a single trailing newline.
339bf645134STomasz Sapetatrailing_newline: warning
340bf645134STomasz Sapeta
341bf645134STomasz Sapeta# Lines should not have trailing semicolons.
342bf645134STomasz Sapetatrailing_semicolon: warning
343bf645134STomasz Sapeta
344bf645134STomasz Sapeta# Lines should not have trailing whitespace.
345bf645134STomasz Sapetatrailing_whitespace:
346bf645134STomasz Sapeta  severity: warning
347bf645134STomasz Sapeta  ignores_empty_lines: false
348bf645134STomasz Sapeta  ignores_comments: false
349bf645134STomasz Sapeta
350bf645134STomasz Sapeta# Type bodies should not span too many lines.
351bf645134STomasz Sapetatype_body_length:
352*66575f0bSTomasz Sapeta  warning: 750
353*66575f0bSTomasz Sapeta  error: 800
354bf645134STomasz Sapeta
355bf645134STomasz Sapeta# Type name should only contain alphanumeric characters, start with an uppercase character and span between 3 and 35 characters in length.
356bf645134STomasz Sapetatype_name:
357bf645134STomasz Sapeta  min_length: 3
358bf645134STomasz Sapeta  max_length:
359bf645134STomasz Sapeta    warning: 40
360bf645134STomasz Sapeta    error: 50
361bf645134STomasz Sapeta
362998b32a0STomasz Sapeta# Unimplemented functions should be marked as unavailable.
363998b32a0STomasz Sapetaunavailable_function: warning
364998b32a0STomasz Sapeta
365bf645134STomasz Sapeta# Parentheses are not needed when declaring closure arguments.
366bf645134STomasz Sapetaunneeded_parentheses_in_closure_argument: warning
367bf645134STomasz Sapeta
368bf645134STomasz Sapeta# Prefer capturing references as weak to avoid potential crashes.
369bf645134STomasz Sapetaunowned_variable_capture: warning
370bf645134STomasz Sapeta
371bf645134STomasz Sapeta# Unused reference in a capture list should be removed.
372bf645134STomasz Sapetaunused_capture_list: warning
373bf645134STomasz Sapeta
374bf645134STomasz Sapeta# Unused parameter in a closure should be replaced with `_`.
375bf645134STomasz Sapetaunused_closure_parameter: warning
376bf645134STomasz Sapeta
377bf645134STomasz Sapeta# Declarations should be referenced at least once within all files linted.
378bf645134STomasz Sapetaunused_declaration:
379bf645134STomasz Sapeta  severity: warning
380bf645134STomasz Sapeta  include_public_and_open: false
381bf645134STomasz Sapeta
382bf645134STomasz Sapeta# When the index or the item is not used, `.enumerated()` can be removed.
383bf645134STomasz Sapetaunused_enumerated: warning
384bf645134STomasz Sapeta
385bf645134STomasz Sapeta# All imported modules should be required to make the file compile.
386bf645134STomasz Sapetaunused_import:
387bf645134STomasz Sapeta  severity: warning
388bf645134STomasz Sapeta
389bf645134STomasz Sapeta# Prefer `!= nil` over `let _ =`
390bf645134STomasz Sapetaunused_optional_binding:
391bf645134STomasz Sapeta  severity: warning
392bf645134STomasz Sapeta  ignore_optional_try: false
393bf645134STomasz Sapeta
394bf645134STomasz Sapeta# Setter value is not used.
395bf645134STomasz Sapetaunused_setter_value: warning
396bf645134STomasz Sapeta
397bf645134STomasz Sapeta# Function parameters should be aligned vertically if they’re in multiple lines in a method call.
398bf645134STomasz Sapetavertical_parameter_alignment_on_call: warning
399bf645134STomasz Sapeta
400bf645134STomasz Sapeta# Limit vertical whitespace to a single empty line.
401bf645134STomasz Sapetavertical_whitespace:
402bf645134STomasz Sapeta  severity: warning
403bf645134STomasz Sapeta  max_empty_lines: 1
404bf645134STomasz Sapeta
405bf645134STomasz Sapeta# Don’t include vertical whitespace (empty line) before closing braces.
406998b32a0STomasz Sapetavertical_whitespace_closing_braces:
407998b32a0STomasz Sapeta  severity: warning
408998b32a0STomasz Sapeta  only_enforce_before_trivial_lines: false
409bf645134STomasz Sapeta
410bf645134STomasz Sapeta# Don’t include vertical whitespace (empty line) after opening braces.
411bf645134STomasz Sapetavertical_whitespace_opening_braces: warning
412bf645134STomasz Sapeta
413bf645134STomasz Sapeta# Prefer `-> Void` over `-> ()`.
414bf645134STomasz Sapetavoid_return: warning
415bf645134STomasz Sapeta
416bf645134STomasz Sapeta# The variable should be placed on the left, the constant on the right of a comparison operator.
417bf645134STomasz Sapetayoda_condition: warning
418