Skip to main content
SwiftLint is a linter for Swift. CodeRabbit runs SwiftLint on supported changed files. CodeRabbit runs SwiftLint 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
When 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_cast and force_try.
  • Assertive enables force_cast, force_try, and additional memory-management and bug-detection rules.
Both profiles enable 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 .swift files exist.
  • SwiftLint is already running in GitHub Actions, GitLab CI, CircleCI, or Azure Pipelines.
  • The config file’s swiftlint_version is greater than the version used by CodeRabbit.

Ignored rules

The following SwiftLint rules are automatically ignored (style rules with very low acceptance):
  • trailing_whitespace
  • line_length
  • comment_spacing
  • vertical_whitespace