Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 260
S.m.g. baquer Avatar asked Jan 21 '26 10:01

S.m.g. baquer


2 Answers

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.

like image 150
Rattanakoudom Sambath Avatar answered Jan 23 '26 05:01

Rattanakoudom Sambath


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

like image 39
TibiaZ Avatar answered Jan 23 '26 03:01

TibiaZ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!