-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Cannot run SwiftLint on any directory other than current working directory #5424
Comments
In my case I want to traverse back two levels with |
So ... ideally SwiftLint should work from anywhere, but there are definitely some spots in the code that assume that you will be executing at the top level of your project (maybe - at least it looks like that in the code), and there is also some complexity around how paths are treated on the command line, for historical reasons. It can be hard to change some of this behaviour, because existing users may be relying on them, even where they don't make sense when looked at afresh. I think SwiftLint should read the |
So I'm interested to know what kind of environment you're in @tahirmt that won't let you Right now swiftlint will assume that there should be a Any thoughts @SimplyDanny ? |
@mildm8nnered my scenario was writing a custom build tool plugin because I want to have a repo to get shared rules from. I wanted to use the tool and execute it in my working directory from the checkout path which is in a derived data. The current plugin is incredibly slow likely because it provides a list of files instead of directories so caching does not work and ends up adding minutes to every build. I want to support nested configs and the only way I can do that is by running sourcery from the root directory but due to how package plugins work the working directory is unchangeable and you don't get shell access. |
New Issue Checklist
Describe the bug
I want to be able to run
swiftlint lint Project/Directory
and be able to have it read the config file located atProject/Directory/.swiftlint.yml
and this does not work. It seems to not read the config file at all. If I pass in the config file using--config
argument then it doesn't read nested.swiftlint.yml
config files so that's not a possible alternative either.Ideally, it should read the config files from the directory but if that's not possible then alternatively I would like a
--working-directory
argument so we can execute it from not the current directory. I have no option to cd to the working directory in my scenario as I am in a controlled environment.Complete output when running SwiftLint, including the stack trace and command used
This is also irrelevant. It shows me thousands of violations for paths that I have ignored in my config file but it doesn't apply the config file.
Environment
swiftlint version
to be sure)? 0.54.0The configuration file itself is not relevant.
The text was updated successfully, but these errors were encountered: