Closed mgrebenets closed 7 years ago
Thanks for filing this issue, @mgrebenets! I'm a bit busy at the moment, but hopefully someone else can help you (yay open source?), otherwise I'll get back to this eventually.
@mgrebenets Could you please check if this is still valid with 0.20.1? We made some changes in this area and this might have been fixed too.
This looks fixed in the latest version:
$ swiftlint
Loading configuration from '.swiftlint.yml'
'variable_name' rule has been renamed to 'identifier_name' and will be completely removed in a future release.
Linting Swift files in current working directory
Linting 'test.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.
$ cat ../.swiftlint.yml
disabled_rules:
- nesting
Feel free to reopen if it's not the case.
I have a top-level swiftlint configuration in my home directory
~/.swiftlint.yml
Then I have another
.swiflint.yml
in the working directory, e.g. in~/example
:Then the
test.swift
file:So no I run
swiftlint lint
in the directory with the test file. All works good, no violations.Next I create a
run.sh
script with the following contents:So then I
chmod +x run.sh
and run it./run.sh
. All good, no violations.Finally, I use the bash function like so in the
run.sh
:And this time if fails with 2 violations.
Somehow the
.swiftlint.yml
in current directory is ignored when running from shell function.If I remove the
~/.swiftlint.yml
the violations will no longer be reported.I have tried to do
${SWIFT_LINT} lint --config $(pwd)/.swiftlint.yml --path "$1"
and it didn't change anythingHere's the complete output: (you can see that
force_cast
is marked as "not enabled in config" but is still reported)This may be related to https://github.com/realm/SwiftLint/issues/554, https://github.com/realm/SwiftLint/issues/550.
Attached the sample setup (does not include the
~/.swiftlint.yml
): swiftlint-issue.zip