Skip to content

Commit 6ff7572

Browse files
committed
Disable nesting rule to allow nested types for hierarchical APIs
1 parent 2a0d070 commit 6ff7572

File tree

1 file changed

+5
-95
lines changed

1 file changed

+5
-95
lines changed

.swiftlint.yml

Lines changed: 5 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,7 @@
1-
# SwiftLint Configuration for swift-standards
2-
# Shared across all packages in the workspace
3-
# Optimized for library/framework development with Swift Testing
1+
# SwiftLint configuration for swift-ieee-754
2+
# Inherits from the shared parent configuration in swift-standards
43

5-
# Disabled rules
6-
disabled_rules:
7-
# Type inference & Swift idioms
8-
- explicit_type_interface # Type inference is idiomatic Swift
9-
- explicit_init # Prefer MyType() over MyType.init()
10-
- extension_access_modifier # Prefer access on members, not extensions
11-
- explicit_acl # Don't require `internal` everywhere
4+
parent_config: https://raw.githubusercontent.com/swift-standards/swift-standards/main/.swiftlint.yml
125

13-
# Development flexibility
14-
- todo # TODOs are fine in development
15-
- force_cast # Sometimes needed in tests
16-
- force_try # Sometimes needed in tests
17-
18-
# Length restrictions (swift-format handles line length)
19-
- line_length # HTML attributes can be 300+ chars; swift-format handles this
20-
- file_length # Comprehensive test files are long
21-
22-
# Domain complexity
23-
- cyclomatic_complexity # Lookup tables and parsing logic have inherent complexity
24-
- function_parameter_count # Time/Date/RFC initializers legitimately need many parameters
25-
- large_tuple # Component tuples are acceptable for internal use
26-
27-
# Documentation patterns
28-
- file_header # No consistent pattern across packages
29-
- missing_docs # Documentation via code comments, not strictly required
30-
31-
# Swift Testing compatibility
32-
- identifier_name # Swift Testing uses backtick names with spaces
33-
- type_name # @Suite uses descriptive names with spaces
34-
35-
# False positives for our patterns
36-
- optional_data_string_conversion # False positive on [UInt8] -> String conversion
37-
- for_where # Not always clearer than for+if
38-
- contains_over_first_not_nil # False positives on custom firstIndex implementations
39-
- sorted_imports # Handled by swift-format's OrderedImports rule
40-
- trailing_comma # Handled by swift-format (adds trailing commas for better diffs)
41-
42-
# Opt-in rules for code quality
43-
opt_in_rules:
44-
# Bug prevention
45-
- unused_optional_binding # Catch unused let bindings
46-
47-
# Code quality & cleanliness
48-
- implicit_optional_initialization # Don't initialize optionals to nil (formerly redundant_optional_initialization)
49-
- redundant_void_return # Don't write -> Void
50-
- empty_string # Use .isEmpty not == ""
51-
- vertical_whitespace # Consistent spacing
52-
53-
# Analyzer rules (require --analyze flag)
54-
analyzer_rules:
55-
- unused_import # Remove unnecessary imports
56-
57-
# Performance optimizations
58-
- empty_count # Use .isEmpty instead of .count == 0
59-
- first_where # Prefer first(where:) over filter().first
60-
- last_where # Prefer last(where:) over filter().last
61-
- contains_over_range_nil_comparison # Better performance
62-
- sorted_first_last # Prefer sorted().first/last
63-
64-
# Style consistency
65-
- closure_spacing # Consistent closure formatting
66-
- operator_usage_whitespace # Consistent operator spacing
67-
68-
# Safety
69-
- array_init # Safer array initialization
70-
- fatal_error_message # Require messages in fatalError
71-
- legacy_random # Use modern random APIs
72-
- overridden_super_call # Ensure super is called when needed
73-
74-
# Paths
75-
included:
76-
- Sources
77-
- Tests
78-
79-
excluded:
80-
- .build
81-
- .swiftpm
82-
83-
# Rule configurations
84-
85-
# Allow longer functions for complex performance logic
86-
function_body_length:
87-
warning: 60
88-
error: 100
89-
90-
# Allow larger types for comprehensive test suites
91-
type_body_length:
92-
warning: 400
93-
error: 600
94-
95-
# Nesting depth
96-
nesting:
97-
type_level: 2
6+
# Package-specific overrides (if needed)
7+
# Add any swift-ieee-754 specific rules here

0 commit comments

Comments
 (0)