Swiftlint on linux hangs
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 19.7k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 11
Description
New Issue Checklist
- Updated SwiftLint to the latest version
- I searched for existing GitHub issues
Describe the bug
I ran into an issue, where swiftlint will run forever on linux and docker.
The command I'm using is
swiftlint lint --reporter markdown --output linter_result.md --config ./.swiftlint.yml
If I add a list of files that have to be check, it will end correctly and write the report into linter_result.md
For this I use:
swiftlint lint --reporter markdown --output linter_result.md --config ./.swiftlint.yml $(git --no-pager diff --name-only --diff-filter=ACMUd --relative main -- '*.swift')
this works perfectly, but every time we have changes in the rules or in the swiftlint version, I want to make sure that all files are scanned.
This does not happen either locally on M1 running macos 13.2.1 or on Github with macOS-12.
I tried using the docker image for 0.50.3 and the same thing happens, it will run indefinitely.
There are a few issues open/closed that could not help me:
- issue: #4215
- issue: #4117 -> PR: #4123
I have removed all custom rules to make sure it is not connected to them, without any success.
Complete output when running SwiftLint, including the stack trace and command used
$ `swiftlint lint --reporter markdown --output linter_result.md --config ./.swiftlint.yml
...
Linting 'SomeSwiftFile.swift' (5897/5897)
Environment
-
SwiftLint version (run
swiftlint versionto be sure)? swiftlint_linux: 0.50.3 / swiftlint_docker: 0.50.3 / macos: 0.50.3 -
Installation method used (Homebrew, CocoaPods, building from source, etc)? via github download / docker
-
Paste your configuration file: irrelevant since it is running fine on macOS and I have exluded it from the command, but still the issue persists
-
Are you using nested configurations? NO
If so, paste their relative paths and respective contents. -
Which Xcode version are you using (check
xcodebuild -version)? 14.2 swift 5.7 -
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 useswiftlint lint --path [file here] --no-cache --enable-all-rules.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing swiftlint lint --reporter markdown --output linter_result.md --config ./.swiftlint.yml with SwiftLint 0.50.3 on Linux or Docker, then compare it with the command restricted to changed files. Done means a full scan terminates on Linux and Docker and writes linter_result.md without requiring custom rules.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100