Configuration file is not applied with 0.47.1
New Issue Checklist
- [ ] Updated SwiftLint to the latest version
- [ ] I searched for existing GitHub issues
Describe the bug
When I run swiftlint lint --config
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 versionto 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
- Are you using nested configurations?
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-rulesto quickly test if your example is really demonstrating the issue. If your example is more complex, you can useswiftlint lint --path [file here] --no-cache --enable-all-rules.
// This triggers a violation:
let foo = try! bar()
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.