Search code examples
iosswiftxcodeswiftlint

How can I turn off line length violations for an entire project when using SwiftLint


I just installed swiftlint and after running it, a lot of my warnings and errors are line length violations. I don't particularly care for how long my lines are. I'm just using SwiftLint to remove more important errors.

Now to be clear, I know I can use a comment like // swiftlint:disable to disable it in one file but I want to disable it across my project. I did have some trouble with the configuration file as well, if you can give me the code for the config, that works too.


Solution

  • Add the line_length rule into the disabled_rules section of your .swiftlint.yml config file

    disabled_rules:
      - line_length