Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.24.1: Invalid configuration for 'indentation'. Falling back to default. #1998

Closed
ileitch opened this issue Jan 9, 2018 · 6 comments
Closed
Labels
bug Unexpected and reproducible misbehavior.

Comments

@ileitch
Copy link

ileitch commented Jan 9, 2018

How are we supposed to use this new indentation feature? I don't see any instructions for it, and I'd rather not have Invalid configuration for 'indentation'. Falling back to default. spamming my output.

@jpsim
Copy link
Collaborator

jpsim commented Jan 9, 2018

Could you please fill out the issue template next time? It has the questions I would ask next based on what you've written.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint

Environment

  • SwiftLint version (run swiftlint version to be sure)?
  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
  • Paste your configuration file:
# insert yaml contents here
  • Are you using nested configurations?
    If so, paste their relative paths and respective contents.
  • Which Xcode version are you using (check xcode-select -p)?
  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
// This triggers a violation:
let foo = try! bar()

@jpsim jpsim added the help Questions or user problems that require more explanation rather than code changes. label Jan 9, 2018
@ornithocoder
Copy link
Contributor

Hi @jpsim. I'm getting the same message (twice, because I have nested config files).

$  Pods/SwiftLint/swiftlint version
0.24.1
$ Pods/SwiftLint/swiftlint 
Loading configuration from '.swiftlint.yml'
Invalid configuration for 'indentation'. Falling back to default.
Linting Swift files in current working directory
Invalid configuration for 'indentation'. Falling back to default.
...
$ cat .swiftlint.yml 
  opt_in_rules:                                                                                                              
    - closure_end_indentation                                                                                                
    - closure_spacing                                                                                                        
    - empty_count                                                                                                            
    - explicit_init                                                                                                          
    - fatal_error_message                                                                                                    
    - file_length                                                                                                            
    - first_where                                                                                                            
    - force_cast                                                                                                             
    - force_try                                                                                                              
    - force_unwrapping                                                                                                       
    - implicitly_unwrapped_optional                                                                                          
    - operator_usage_whitespace                                                                                              
    - overridden_super_call                                                                                                  
    - prohibited_super_call                                                                                                  
    - redundant_nil_coalescing                                                                                               
    - multiline_parameters                                                                                                   
    - file_header                                                                                                            
    - vertical_parameter_alignment_on_call                                                                                   
    - joined_default_parameter                                                                                               
    - unneeded_parentheses_in_closure_argument                                                                               
    - trailing_closure                                                                                                       
    - private_action                                                                                                         
    - discouraged_object_literal                                                                                             
    - yoda_condition                                                                                                         
    - prefixed_toplevel_constant                                                                                             
                                                                                                                             
  excluded:                                                                                                                                                                                                 
    - Pods                                                                                                                   
    - ci                                                                                                                     
    - fastlane                                                                                                               
                                                                                                                             
  identifier_name:                                                                                                           
    min_length:                                                                                                              
      error: 3                                                                                                               
    excluded:                                                                                                                
      - id                                                                                                                   
      - to                                     

custom_rules:
  quickspec_class_name:
    name: "Invalid Test Class Name"
    regex: "class\\s+(.*)[^Tests]:\\s+QuickSpec"
    message: "A test class name must end with 'Tests'"
    severity: error
$ cat Tests/.swiftlint.yml 
disabled_rules:
  - line_length
  - file_length
  - type_body_length
  - function_body_length
  - type_name
  - cyclomatic_complexity

opt_in_rules:
  - xctfail_message
  - single_test_class
  - quick_discouraged_call
  - discouraged_direct_init
  - quick_discouraged_focused_test
  - quick_discouraged_pending_test

discouraged_direct_init:
  types:
    - Bundle
    - UIDevice
    - UIWindow

@jpsim jpsim added bug Unexpected and reproducible misbehavior. and removed help Questions or user problems that require more explanation rather than code changes. labels Jan 10, 2018
@jpsim
Copy link
Collaborator

jpsim commented Jan 10, 2018

Alright, I managed to reproduce this just by running swiftlint in the root of SwiftLint's source at the current master (569937f). Will fix.

@jpsim jpsim closed this as completed in e70710b Jan 10, 2018
@jpsim
Copy link
Collaborator

jpsim commented Jan 10, 2018

Fixed. Thanks for reporting. Next time please do fill out the issue template however.

@ileitch
Copy link
Author

ileitch commented Jan 13, 2018

@jpsim Will do. Is there any instruction anywhere about how to use this indentation feature?

@jpsim
Copy link
Collaborator

jpsim commented Jan 13, 2018

#319 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

3 participants