SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

Configuration file is not applied with 0.47.1

Open flockoffiles opened this issue 3 years ago • 1 comments

New Issue Checklist

Describe the bug

When I run swiftlint lint --config , the config file is not applied.

When I copy my swiftlint.yml to the folder from which swiftlint is run (as .swiftlint.yml), the configuration file is applied correctly.

A clear and concise description of what the bug is.

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

Environment

  • SwiftLint version (run swiftlint version to be sure)?

0.47.1

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?

Installed from https://github.com/realm/SwiftLint/releases/download/0.47.1/portable_swiftlint.zip

  • Paste your configuration file:
disabled_rules:
- function_parameter_count
- identifier_name
- type_name
- trailing_whitespace
- fallthrough

opt_in_rules:
- empty_count
- first_where

cyclomatic_complexity:
  ignores_case_statements: true

file_length:
- 600

type_body_length:
- 450 # warning
- 700 # error

line_length:
- 300 # warning

large_tuple:
- 3 # warning

excluded: 
  - Carthage
  - .git
  - .build # output from swift package manager (SPM)
  - BuildTools/.build # output from scripts build with SPM
  - ios
  - spm
  - iOSOnePipeline
  - build
  - results

NO

  • Which Xcode version are you using (check xcodebuild -version)?

Xcode 13.3 Build version 13E113

  • 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()

flockoffiles avatar May 17 '22 14:05 flockoffiles

It works for me. I run swiftlint lint --config ../.swiftlint.yml in a directory with one Swift file while the configuration is located in the parent directory. Disabling/enabling specific rules in the configuration shows that it is considered.

Please describe your folder/file structure in more detail, try to reduce the configuration and more clearly explain what doesn't work in your case.

SimplyDanny avatar Jun 25 '22 20:06 SimplyDanny