Swiftpack.co - Package - realm/SwiftLint


A tool to enforce Swift style and conventions, loosely based on GitHub's Swift Style Guide.

SwiftLint hooks into Clang and SourceKit to use the AST representation of your source files for more accurate results.

CircleCI codecov.io

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to info@realm.io.

Language Switch: 中文, 한국어.


Using Homebrew:

brew install swiftlint

Using CocoaPods:

Simply add the following line to your Podfile:

pod 'SwiftLint'

This will download the SwiftLint binaries and dependencies in Pods/ during your next pod install execution and will allow you to invoke it via ${PODS_ROOT}/SwiftLint/swiftlint in your Script Build Phases.

This is the recommended way to install a specific version of SwiftLint since it supports installing a pinned version rather than simply the latest (which is the case with Homebrew).

Note that this will add the SwiftLint binaries, its dependencies' binaries and the Swift binary library distribution to the Pods/ directory, so checking in this directory to SCM such as git is discouraged.

Using Mint:

$ mint run realm/SwiftLint

Using a pre-built package:

You can also install SwiftLint by downloading SwiftLint.pkg from the latest GitHub release and running it.

Compiling from source:

You can also build from source by cloning this project and running git submodule update --init --recursive; make install (Xcode 9.0 or later).



To get a high-level overview of recommended ways to integrate SwiftLint into your project, we encourage you to watch this presentation or read the transcript:



Integrate SwiftLint into an Xcode scheme to get warnings and errors displayed in the IDE. Just add a new "Run Script Phase" with:

if which swiftlint >/dev/null; then
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"

Alternatively, if you've installed SwiftLint via CocoaPods the script should look like this:


Format on Save Xcode Plugin

To run swiftlint autocorrect on save in Xcode, install the SwiftLintXcode plugin from Alcatraz.

⚠️This plugin will not work with Xcode 8 or later without disabling SIP. This is not recommended.


To integrate SwiftLint with AppCode, install this plugin and configure SwiftLint's installed path in the plugin's preferences. The autocorrect action is available via ⌥⏎.


To integrate SwiftLint with Atom, install the linter-swiftlint package from APM.


You can use the official swiftlint fastlane action to run SwiftLint as part of your fastlane process.

    mode: :lint,                            # SwiftLint mode: :lint (default) or :autocorrect
    executable: "Pods/SwiftLint/swiftlint", # The SwiftLint binary path (optional). Important if you've installed it via CocoaPods
    path: "/path/to/lint",                  # Specify path to lint (optional)
    output_file: "swiftlint.result.json",   # The path of the output file (optional)
    reporter: "json",                       # The custom reporter to use (optional)
    config_file: ".swiftlint-ci.yml",       # The path of the configuration file (optional)
    files: [                                # List of files to process (optional)
    ignore_exit_status: true,               # Allow fastlane to continue even if SwiftLint returns a non-zero exit status (Default: false)
    quiet: true,                            # Don't print status logs like 'Linting ' & 'Done linting' (Default: false)
    strict: true                            # Fail on warnings? (Default: false)

Command Line

$ swiftlint help
Available commands:

   analyze         [Experimental] Run analysis rules
   autocorrect     Automatically correct warnings and errors
   generate-docs   Generates markdown documentation for all rules
   help            Display general or command-specific help
   lint            Print lint warnings and errors (default command)
   rules           Display the list of rules and their identifiers
   version         Display the current version of SwiftLint

Run swiftlint in the directory containing the Swift files to lint. Directories will be searched recursively.

To specify a list of files when using lint, autocorrect or analyze (like the list of files modified by Xcode specified by the ExtraBuildPhase Xcode plugin, or modified files in the working tree based on git ls-files -m), you can do so by passing the option --use-script-input-files and setting the following instance variables: SCRIPT_INPUT_FILE_COUNT and SCRIPT_INPUT_FILE_0, SCRIPT_INPUT_FILE_1...SCRIPT_INPUT_FILE_{SCRIPT_INPUT_FILE_COUNT}.

These are same environment variables set for input files to custom Xcode script phases.

Working With Multiple Swift Versions

SwiftLint hooks into SourceKit so it continues working even as Swift evolves!

This also keeps SwiftLint lean, as it doesn't need to ship with a full Swift compiler, it just communicates with the official one you already have installed on your machine.

You should always run SwiftLint with the same toolchain you use to compile your code.

You may want to override SwiftLint's default Swift toolchain if you have multiple toolchains or Xcodes installed.

Here's the order in which SwiftLint determines which Swift toolchain to use:

  • xcrun -find swift
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • ~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • ~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

sourcekitd.framework is expected to be found in the usr/lib/ subdirectory of the value passed in the paths above.

You may also set the TOOLCHAINS environment variable to the reverse-DNS notation that identifies a Swift toolchain version:

$ TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3 swiftlint autocorrect

On Linux, SourceKit is expected to be located in /usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH environment variable.

Swift Version Support

Here's a reference of which SwiftLint version to use for a given Swift version.

| Swift version | Last supported SwiftLint release | | ------------- | -------------------------------- | | Swift 1.x | SwiftLint 0.1.2 | | Swift 2.x | SwiftLint 0.18.1 | | Swift 3.x | Latest | | Swift 4.x | Latest |


Over 75 rules are included in SwiftLint and the Swift community (that's you!) continues to contribute more over time. Pull requests are encouraged.

You can find an updated list of rules and more information about them in Rules.md.

You can also check Source/SwiftLintFramework/Rules directory to see their implementation.

Opt-In Rules

opt_in_rules are disabled by default (i.e., you have to explicitly enable them in your configuration file).

Guidelines on when to mark a rule as opt-in:

  • A rule that can have many false positives (e.g. empty_count)
  • A rule that is too slow
  • A rule that is not general consensus or is only useful in some cases (e.g. force_unwrapping)

Disable rules in code

Rules can be disabled with a comment inside a source file with the following format:

// swiftlint:disable <rule1> [<rule2> <rule3>...]

The rules will be disabled until the end of the file or until the linter sees a matching enable comment:

// swiftlint:enable <rule1> [<rule2> <rule3>...]

For example:

// swiftlint:disable colon
let noWarning :String = "" // No warning about colons immediately after variable names!
// swiftlint:enable colon
let hasWarning :String = "" // Warning generated about colons immediately after variable names

Including the all keyword will disable all rules until the linter sees a matching enable comment:

// swiftlint:disable all // swiftlint:enable all

For example:

// swiftlint:disable all
let noWarning :String = "" // No warning about colons immediately after variable names!
let i = "" // Also no warning about short identifier names
// swiftlint:enable all
let hasWarning :String = "" // Warning generated about colons immediately after variable names
let y = "" // Warning generated about short identifier names

It's also possible to modify a disable or enable command by appending :previous, :this or :next for only applying the command to the previous, this (current) or next line respectively.

For example:

// swiftlint:disable:next force_cast
let noWarning = NSNumber() as! Int
let hasWarning = NSNumber() as! Int
let noWarning2 = NSNumber() as! Int // swiftlint:disable:this force_cast
let noWarning3 = NSNumber() as! Int
// swiftlint:disable:previous force_cast

Run swiftlint rules to print a list of all available rules and their identifiers.


Configure SwiftLint by adding a .swiftlint.yml file from the directory you'll run SwiftLint from. The following parameters can be configured:

Rule inclusion:

  • disabled_rules: Disable rules from the default enabled set.
  • opt_in_rules: Enable rules not from the default set.
  • whitelist_rules: Acts as a whitelist, only the rules specified in this list will be enabled. Can not be specified alongside disabled_rules or opt_in_rules.
  • analyzer_rules: This is an entirely separate list of rules that are only run by the analyze command. All analyzer rules are opt-in, so this is the only configurable rule list (there is no disabled/whitelist equivalent).
disabled_rules: # rule identifiers to exclude from running
  - colon
  - comma
  - control_statement
opt_in_rules: # some rules are only opt-in
  - empty_count
  # Find all the available rules by running:
  # swiftlint rules
included: # paths to include during linting. `--path` is ignored if present.
  - Source
excluded: # paths to ignore during linting. Takes precedence over `included`.
  - Carthage
  - Pods
  - Source/ExcludedFolder
  - Source/ExcludedFile.swift
  - Source/*/ExcludedFile.swift # Exclude files with a wildcard
analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
  - explicit_self

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
  severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 110
# they can set both implicitly with an array
  - 300 # warning
  - 400 # error
# or they can set both explicitly
  warning: 500
  error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
  min_length: 4 # only warning
  max_length: # warning and error
    warning: 40
    error: 50
  excluded: iPhone # excluded via string
  min_length: # only min_length
    error: 4 # only error
  excluded: # excluded via string array
    - id
    - URL
    - GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube)

You can also use environment variables in your configuration file, by using ${SOME_VARIABLE} in a string.

Defining Custom Rules

You can define custom regex-based rules in your configuration file using the following syntax:

  pirates_beat_ninjas: # rule identifier
    included: ".*\\.swift" # regex that defines paths to include during linting. optional.
    excluded: ".*Test\\.swift" # regex that defines paths to exclude during linting. optional
    name: "Pirates Beat Ninjas" # rule name. optional.
    regex: "([n,N]inja)" # matching pattern
    match_kinds: # SyntaxKinds to match. optional.
      - comment
      - identifier
    message: "Pirates are better than ninjas." # violation message. optional.
    severity: error # violation severity. optional.
    regex: "([n,N]inja)"
    match_kinds: string

This is what the output would look like:

You can filter the matches by providing one or more match_kinds, which will reject matches that include syntax kinds that are not present in this list. Here are all the possible syntax kinds:

  • argument
  • attribute.builtin
  • attribute.id
  • buildconfig.id
  • buildconfig.keyword
  • comment
  • comment.mark
  • comment.url
  • doccomment
  • doccomment.field
  • identifier
  • keyword
  • number
  • objectliteral
  • parameter
  • placeholder
  • string
  • string_interpolation_anchor
  • typeidentifier

If using custom rules alongside a whitelist, make sure to add custom_rules as an item under whitelist_rules.

Nested Configurations

SwiftLint supports nesting configuration files for more granular control over the linting process.

  • Include additional .swiftlint.yml files where necessary in your directory structure.
  • Each file will be linted using the configuration file that is in its directory or at the deepest level of its parent directories. Otherwise the root configuration will be used.
  • excluded and included are ignored for nested configurations.


SwiftLint can automatically correct certain violations. Files on disk are overwritten with a corrected version.

Please make sure to have backups of these files before running swiftlint autocorrect, otherwise important data may be lost.

Standard linting is disabled while correcting because of the high likelihood of violations (or their offsets) being incorrect after modifying a file while applying corrections.

Analyze (experimental)

The experimental swiftlint analyze command can lint Swift files using the full type-checked AST. The compiler log path containing the clean swiftc build command invocation (incremental builds will fail) must be passed to analyze via the --compiler-log-path flag. e.g. --compiler-log-path /path/to/xcodebuild.log

This can be obtained by running xcodebuild -workspace {WORKSPACE}.xcworkspace -scheme {SCHEME} > xcodebuild.log with a clean DerivedData folder.

This command and related code in SwiftLint is subject to substantial changes at any time while this feature is marked as experimental. Analyzer rules also tend to be considerably slower than lint rules.


MIT licensed.


SwiftLint is maintained and funded by Realm Inc. The names and logos for Realm are trademarks of Realm Inc.

We :heart: open source software! See our other open source projects, read our blog, or say hi on twitter (@realm).


Stars: 10573
Help us keep the lights on


0.28.0 - Nov 14, 2018


  • Completely remove the --use-tabs option of the autocorrect command that was deprecated in 0.24.1. In its place, define an indentation key in your configuration files.
    JP Simard


  • Add a new swiftlint analyze command which can lint Swift files using the full type-checked AST. Rules of the AnalyzerRule type will be added over time. The compiler log path containing the clean swiftc build command invocation (incremental builds will fail) must be passed to analyze via the --compiler-log-path flag. e.g. --compiler-log-path /path/to/xcodebuild.log
    JP Simard

  • Add an explicit_self analyzer rule to enforce the use of explicit references to self. when accessing instance variables or functions.
    JP Simard #321

  • Add an unused_import analyzer rule to lint for unnecessary imports.
    JP Simard #2248

  • Add an unused_private_declaration analyzer rule to lint for unused private declarations.
    JP Simard


  • Add legacy_random opt-in rule to encourage the use of .random(in:) instead of arc4random, arc4random_uniform, and drand48.
    Joshua Kaplan

  • Improve performance of line_length and multiple_closures_with_trailing_closure rules.
    Marcelo Fabri

  • Add closure_body_length opt-in rule to enforce the maximum number of lines a closure should have. Requires Swift 4.2.
    Ornithologist Coder #52

  • Add SonarQube reporter.
    Yusuke Ohashi #2350

  • Add prohibited_interface_builder opt-in rule to validate that @IBOutlets and @IBActions are not used.
    Marcelo Fabri #2365

  • Add inert_defer rule to validate that defer is not used at the end of a scope.
    Marcelo Fabri #2123

  • Add toggle_bool opt-in rule which suggests using someBool.toggle() over someBool = !someBool. Requires Swift 4.2.
    Dalton Claybrook #2369

  • Add identical_operands opt-in rule to validate that operands are different expressions in comparisons.
    Marcelo Fabri #1371

  • Add collection_alignment opt-in rule to validate that all elements in a collection literal are aligned vertically.
    Dalton Claybrook #2326

  • Add static_operator opt-in rule to enforce that operators are declared as static functions instead of free functions.
    Marcelo Fabri #2395

  • Specify what type of compiler protocol initializer violated the compiler_protocol_init rule.
    Timofey Solonin #2422

Bug Fixes

  • Fix comma rule false positives on object literals (for example, images).
    Marcelo Fabri #2345

  • Fix false positive on file_name rule when using nested types.
    Marcelo Fabri #2325

  • Fix crash on multiline_function_chains rule when using some special characters inside the function calls.
    Marcelo Fabri #2360

  • Change autocorrect --format to run format before autocorrect, fixing conflicts between default indentation and rules which modify indentation (i.e. closure_end_indentation).
    Ornithologist Coder #2374

  • Fix false positive on empty_count rule when assessing binary, octal and hexadecimal integer literals.
    Timofey Solonin #2423

0.27.0 - Jul 31, 2018


  • None.


  • Append modifier_order description with failure reason.
    Daniel Metzing #2269

  • Decrease default severity of superfluous_disable_command to warning.
    Frederick Pietschmann #2250

  • Don't touch files when running autocorrect --format if the contents haven't changed.
    Marcelo Fabri #2249

  • Add only_enforce_after_first_closure_on_first_line configuration to multiline_arguments
    Mike Ciesielka #1896

  • Add anyobject_protocol opt-in rule which suggests using AnyObject over class for class-only protocols.
    Ornithologist Coder #2283

  • Add options prefix_pattern and suffix_pattern to rule file_name.
    Cihat Gündüz #2309

  • Add new bool config option if_only to rule conditional_returns_on_newline to specify that the rule should only be applied to if statements.
    Cihat Gündüz #2307

  • Add support for globs in excluded file paths.
    Keith Smiley #2316

  • Add only_private configuration to prefixed_toplevel_constant rule.
    Keith Smiley #2315

  • Make rule explicit_type_interface compatible with rule redundant_type_annotation via new option allow_redundancy.
    Cihat Gündüz #2312

  • Add missing_docs rule to warn against undocumented declarations.
    Nef10 Andrés Cecilia Luque #1652

Bug Fixes

  • Fix an issue with control_statement where commas in clauses prevented the rule from applying.
    Allen Wu

  • Fix explicit_enum_raw_value, generic_type_name, implicit_return, required_enum_case, quick_discouraged_call, array_init, closure_parameter_position and unused_closure_parameter rules when linting with Swift 4.2.
    Marcelo Fabri

  • Fix identifier_name rule false positives with enum when linting using Swift 4.2.
    Marcelo Fabri Jacob Greenfield #2231

  • Fix a crash when running with Swift 4.2.
    Norio Nomura SR-7954

  • Fix false positive on attributes rule when linting a line that is below a line with a declaration that has attributes.
    Marcelo Fabri #2297

  • redundant_optional_initialization rule now lints local variables.
    Marcelo Fabri #2233

  • Fix autocorrection for redundant_type_annotation rule.
    Marcelo Fabri #2314

0.26.0 - Jun 22, 2018



  • Add optional filename verification to the file_header rule. All occurrences in the pattern of the SWIFTLINT_CURRENT_FILENAME placeholder are replaced by the name of the validated file.
    Anders Hasselqvist #1079

  • Updates the untyped_error_in_catch rule to support autocorrection.
    Daniel Metzing

  • Add no_fallthrough_only rule to check that case statements do not contain only a fallthrough.
    Austin Belknap

  • Add indented_cases support to switch_case_alignment rule.
    Shai Mishali #2119

  • Add opt-in modifier_order to enforce the order of declaration modifiers. Requires Swift 4.1 or later.
    Jose Cheyo Jimenez Daniel Metzing #1472 #1585

  • Validate implicit subscript getter in implicit_getter rule when using Swift 4.1 or later.
    Marcelo Fabri #898

  • Add unavailable_function opt-in rule to validate that functions that are currently unimplemented (using a placeholder fatalError) are marked with @available(*, unavailable).
    Marcelo Fabri #2127

  • Updates the closure_end_indentation rule to support autocorrection.
    Eric Horacek

  • Updates the literal_expression_end_indentation rule to support autocorrection.
    Eric Horacek

  • Add a new multiline_function_chains rule to validate that chained function calls start either on the same line or one per line.
    Eric Horacek #2214

  • Improves the mark rule's autocorrection.
    Eric Horacek

  • Add redundant_set_access_control rule to warn against using redundant setter ACLs on variable declarations.
    Marcelo Fabri #1869

  • Add a new ignores_interpolated_strings config parameter to the line_length rule to ignore lines that include interpolated strings from this rule.
    Michael Gray #2100

  • Add a new ignores_default_parameters config parameter to the function_parameter_count rule to ignore default parameter when calculating parameter count. True by default.
    Varun P M #2171

  • Add empty_xctest_method opt-in rule which warns against empty XCTest methods.
    Ornithologist Coder #2190

  • Add function_default_parameter_at_end opt-in rule to validate that parameters with defaults are located toward the end of the parameter list in a function declaration.
    Marcelo Fabri #2176

  • Add file_name opt-in rule validating that file names contain the name of a type or extension declared in the file (if any).
    JP Simard #1420

  • Add convenience_type opt-in rule to validate that types hosting only static members should be enums to avoid instantiation.
    Marcelo Fabri #1871

Bug Fixes

  • Update LowerACLThanParent rule to not lint extensions.
    Keith Smiley #2164

  • Fix operator usage spacing nested generics false positive.
    Eric Horacek #1341 #1897

  • Fix autocorrection for several rules (empty_parentheses_with_trailing_closure, explicit_init, joined_default_parameter, redundant_optional_initialization and unused_closure_parameter) when used with preprocessor macros.
    John Szumski Marcelo Fabri

  • Fix unneeded_parentheses_in_closure_argument false negatives when multiple violations are nested.
    Marcelo Fabri #2188

  • Fix false negatives in implicit_return rule when using closures as function arguments.
    Marcelo Fabri #2187

  • Fix false positives in attributes rule when @testable is used.
    Marcelo Fabri #2211

  • Fix false positives in prohibited_super_call rule.
    Marcelo Fabri #2212

  • Fix a false positive in unused_closure_parameter rule when a parameter is used in a string interpolation.
    Marcelo Fabri #2062

  • Fixes a case where the closure_end_indentation rule wouldn't lint the end indentation of non-trailing closure parameters.
    Eric Horacek #2121

0.25.1 - Apr 8, 2018

This is the last release to support building with Swift 3.2 and Swift 3.3. The next release will require Swift 4.0 or higher to build.


  • None.


  • Add LowerACLThanParent rule.
    Keith Smiley #2136

  • Add UIOffsetMake to legacy_constructor rule.
    Nealon Young #2126

  • Add a new excluded config parameter to the explicit_type_interface rule to exempt certain types of variables from the rule.
    Rounak Jain #2028

  • Add empty_string opt-in rule to validate against comparing strings to "" instead of using .isEmpty.
    Davide Sibilio

  • Add untyped_error_in_catch opt-in rule to warn against declaring errors without an explicit type in catch statements instead of using the implicit error variable.
    Daniel Metzing #2045

  • Add all keyword for use in disable / enable statement: // swiftlint:disable all. It allows disabling SwiftLint entirely, in-code, for a particular section.
    fredpi #2071

  • Adds --force-exclude option to lint and autocorrect commands, which will force SwiftLint to exclude files specified in the config excluded even if they are explicitly specified with --path.
    Ash Furrow #2051

  • Adds discouraged_optional_collection opt-in rule to encourage the use of empty collections instead of optional collections.
    Ornithologist Coder #1885

  • Add 4.1.0, 4.1.1 and 4.2.0 to Swift version detection.
    Norio Nomura #2143

  • Support building with Swift 4.1.
    Norio Nomura #2038

Bug Fixes

  • Fixes an issue with the yoda_condition rule where the severity would always display as a warning, and the reason would display as the severity type.

  • Fix TODOs lint message to state that TODOs should be resolved instead of avoided.
    Adonis Peralta #150

  • Fix some cases where colon rule wouldn't autocorrect dictionary literals.
    Marcelo Fabri #2050

  • Fix linux crash on sources with surrogate pair emojis as variable names.
    Cyril Lashkevich

  • Make legacy_constructor rule more reliable, especially for autocorrecting.
    Marcelo Fabri #2098

  • Fix colon rule autocorrect when preprocessor macros are present.
    Marcelo Fabri #2099

  • Fix crash when saving cache if there're entries referring to the same path but with different capitalization.
    Marcelo Fabri #2032

  • Fix several rules (empty_enum_arguments, explicit_init empty_parentheses_with_trailing_closure, joined_default_parameter, redundant_optional_initialization, redundant_void_return and unused_closure_parameter) rules autocorrection inside functions or other declarations.
    Marcelo Fabri

  • Fix redundant_void_return rule autocorrect when preprocessor macros are present.
    John Szumski #2115

  • Fix issue where the autocorrect done message used the plural form of "files" even if only 1 file changed.
    John Szumski

  • Fix false positives in attributes rule when using Swift 4.1.
    Marcelo Fabri #2125 #2141

0.25.0 - Feb 12, 2018


  • None.


Bug Fixes

  • Fix some cases where colon rule wouldn't be autocorrected.
    Manabu Nakazawa

  • Fix false positives in explicit_acl rule when declaring functions and properties in protocols or implementing deinit.
    Marcelo Fabri #2014

  • Fix false negatives in unneeded_parentheses_in_closure_argument rule when using _ as one of the closure arguments.
    Marcelo Fabri #2017

  • Fix several rules that use attributes when linting with a Swift 4.1 toolchain.
    Marcelo Fabri #2019

  • Don't trigger violations in let_var_whitespace rule when using local variables when linting with a Swift 4.1 toolchain.
    Marcelo Fabri #2021

  • Improve type_name rule violations to be positioned on the type name.
    Marcelo Fabri #2021

  • Use SourceKit to validate associatedtype and typealias in type_name rule when linting with Swift 4.1.
    Marcelo Fabri #2021

  • Fix some cases where violations would still be triggered when using the  ignores_function_declarations configuration of line_length rule.
     Manabu Nakazawa

  • Fix false positive in empty_enum_arguments rule when using closures.
    Marcelo Fabri #2041

  • Fix false positives in force_unwrapping rule when declaring functions that return implicitly unwrapped collections (for example [Int]! or [AnyHashable: Any]!).
    Marcelo Fabri #2042

  • Fix directories with a .swift suffix being treated as files.
    Jamie Edge #1948