S.m.g. baquer
S.m.g. baquer

Reputation: 429

How to disable the character limit in swiftlint config file

I am working on a project and i need to how to disable the character limit in swiftlint config file , so how to disable the character limit ??

Here is the swiftlint file

disabled_rules:
  - force_cast
  - force_try
  - variable_name
  - type_name
  - file_length
  - type_body_length
  - cyclomatic_complexity
  - function_body_length
  - valid_docs
  - trailing_whitespace

opt_in_rules:
  - empty_string

excluded:
  - Carthage
  - Pods
  - SwiftLint/Common/3rdPartyLib

line_length:
    warning: 150
    error: 200
    ignores_function_declarations: true
    ignores_comments: true
    ignores_urls: true

custom_rules:
  smiley_face:
    name: "Smiley Face"
    regex: '( :\))'
    match_kinds:
      - comment
      - string
    message: "A closing parenthesis smiley :) creates a half-hearted smile, and thus is not preferred. Use :]"
severity: warning

Upvotes: 2

Views: 7290

Answers (2)

Rattanakoudom Sambath
Rattanakoudom Sambath

Reputation: 514

If you face some problem with this warning:

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'by' (identifier_name) 

You can add these command to your configuration file:

variable_name:   
max_length:
    warning: 45
    error: 60   
min_length:
    warning: 1

I hope this helps you and fits with your question.

Upvotes: 6

TibiaZ
TibiaZ

Reputation: 750

I guess you can do it adding line_length inside disabled_rules, if that's what you mean.

Upvotes: 3

Related Questions