v0.65.1.
Files
SwiftLint will run on files with the following extensions:.swift
Configuration
boolean
default:true
Enable SwiftLint: SwiftLint is a Swift linter.
string
Optional path to the SwiftLint configuration file relative to the repository. This is useful when the configuration file is named differently than the default ‘.swiftlint.yml’ or ‘.swiftlint.yaml’.
- .coderabbit.yaml
- Web UI
.coderabbit.yaml
config_file is not set, CodeRabbit checks .swiftlint.yaml and then .swiftlint.yml in the repository root. If no config file is found, CodeRabbit generates a temporary configuration based on the selected review profile.
Profile behavior
When CodeRabbit generates the SwiftLint configuration:- Chill focuses on higher-confidence findings and disables
force_castandforce_try. - Assertive enables
force_cast,force_try, and additional memory-management and bug-detection rules.
strong_iboutlet, self_in_property_initialization, and private_swiftui_state. A repository-provided configuration takes precedence over these generated settings.
Security policy and restrictions
SwiftLint runs inside the CodeRabbit sandbox with a declarative YAML configuration and explicit Swift source files. CodeRabbit does not load repository code, plugins, or executable hooks when running SwiftLint.When we skip SwiftLint
CodeRabbit will skip running SwiftLint when:- SwiftLint is disabled in CodeRabbit settings or
.coderabbit.yaml. - No changed
.swiftfiles exist. - SwiftLint is already running in GitHub Actions, GitLab CI, CircleCI, or Azure Pipelines.
- The config file’s
swiftlint_versionis greater than the version used by CodeRabbit.
Ignored rules
The following SwiftLint rules are automatically ignored (style rules with very low acceptance):trailing_whitespaceline_lengthcomment_spacingvertical_whitespace