Closed JozefLipovsky closed 2 weeks ago
Where is your .swiftlint.yml
located in your folder hierarchy? Where do the Swift files reside?
.swiftlint.yml
is in the root folder /LintTest
, and swift files are in separate modules sub-folder(s) LintTest/Packages/Modules/Sources/Feature/
. Here is a sample test repo.
I don't recall the exact reason, but configuration files outside of your working directory cannot be accessed. What works, however, is to place another .swiftlint.yml
file with the content
parent_config: ../../.swiftlint.yml
next to your Package.swift
.
Perfect, this worked https://github.com/JozefLipovsky/LintTest/commit/24507719900b8e334d00b1d77aa54ff0dcde45cf & https://github.com/JozefLipovsky/LintTest/commit/adf55c04f447ff6fb02848dda971a6882ae5a2db. Thank you so much @SimplyDanny 👍
New Issue Checklist
Describe the bug
I have a simple modular project (public sample project repo) configured with a package description like this:
And I have a
.swiftlint.yml
file for custom linting rules:I first noticed this on the
nesting
type_level rule warnings but I also addedforce_cast
andcolumn
violations in my example:When I run
swiftlint lint
from the command line, the linter applies my configurations correctly, and I get the expected results (based ondisabled_rules
andnesting
rule config):However, when I build the project using Xcode, the linting rules specified in the
.swiftlint.yml
file seem to be ignored. The same setup was working fine before. I am not sure if it could beXcode
orSwiftLint
package version update. Any ideas what am I missing here, please?Xcode logs:
Environment
0.55.1
Homebrew
No
Xcode 15.4, Build version 15F31d