megalinter
megalinter copied to clipboard
Linting swift code does not work. Error: No lintable files found at paths: '/tmp/lint'
Describe the bug
Linting swift code does not work. The error appears:
...
Status: Downloaded newer image for norionomura/swiftlint:latest
The `swiftlint autocorrect` command is no longer available.
Please use `swiftlint --fix` instead.
Error: No lintable files found at paths: '/tmp/lint'
Correcting Swift files at paths /tmp/lint
To Reproduce Steps to reproduce the behavior:
- Follow the quick start CLI to add mega-linter to the iOS Swift project
- Accept default values (except one case where you choose that it's a Swift project)
- Push to the repo, create a PR to trigger the GitHub Action
- See swift-lint error (not related to the codebase)
Expected behavior
-
swift-lint
starts linting the code base.
Screenshots

- Contents of
ERROR-SWIFT_SWIFTLINT.log
Results of swiftlint linter (version 0.43.1)
See documentation on https://nvuillam.github.io/mega-linter/descriptors/swift_swiftlint/
-----------------------------------------------
❌ [ERROR] for workspace /github/workspace
Linter raw log:
Unable to find image 'norionomura/swiftlint:latest' locally
latest: Pulling from norionomura/swiftlint
34667c7e4631: Pulling fs layer
d18d76a881a4: Pulling fs layer
119c7358fbfc: Pulling fs layer
2aaf13f3eff0: Pulling fs layer
969975223755: Pulling fs layer
1ea85296b57d: Pulling fs layer
178f29677290: Pulling fs layer
5f015d65fccd: Pulling fs layer
2aaf13f3eff0: Waiting
969975223755: Waiting
1ea85296b57d: Waiting
178f29677290: Waiting
5f015d65fccd: Waiting
d18d76a881a4: Verifying Checksum
d18d76a881a4: Download complete
119c7358fbfc: Verifying Checksum
119c7358fbfc: Download complete
2aaf13f3eff0: Verifying Checksum
2aaf13f3eff0: Download complete
1ea85296b57d: Verifying Checksum
1ea85296b57d: Download complete
34667c7e4631: Verifying Checksum
34667c7e4631: Download complete
5f015d65fccd: Verifying Checksum
5f015d65fccd: Download complete
969975223755: Verifying Checksum
969975223755: Download complete
34667c7e4631: Pull complete
178f29677290: Verifying Checksum
178f29677290: Download complete
d18d76a881a4: Pull complete
119c7358fbfc: Pull complete
2aaf13f3eff0: Pull complete
969975223755: Pull complete
1ea85296b57d: Pull complete
178f29677290: Pull complete
5f015d65fccd: Pull complete
Digest: sha256:2b118a4b74998159c4aa3cd3ccf6d73074bec6ad70cfab0be28f4459754a0640
Status: Downloaded newer image for norionomura/swiftlint:latest
The `swiftlint autocorrect` command is no longer available.
Please use `swiftlint --fix` instead.
Error: No lintable files found at paths: '/tmp/lint'
Correcting Swift files at paths /tmp/lint
- Contents of
.swiftlint.yml
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
disabled_rules: # rule identifiers to exclude from running
- force_cast
- force_try # Remove when done
- type_name
- identifier_name
- type_body_length
- file_length
cyclomatic_complexity:
ignores_case_statements: true
Is there anyone able to help with this?
@r3econ I can, but i have a lot of work for the job i'm actually paid for, but I promise I'll try to solve that in y available free time :) If someone else want to give it a try before that, it would be very welcome of course !
I could also try to solve it but I'd need some hints. Do you know what is causing the problem there, where to start looking?.
You could try to replace --fix by autocorrect in the swift descriptor cli_lint_fix_arg, maybe it would solve the issue
@r3econ i made the update I suggested, the test case passes, but please you check if it works with latest/insiders version ? ( not V4) and close the issue if it is fixed ?
Thanks a lot! I tested, changed the action invocation in the workflow to use the latest tag like in the screenshot below.

However, I'm still getting the same error ErrCorrecting Swift files at paths /tmp/lint or: No lintable files found at paths: '/tmp/lint'
. Am I testing it correctly? I'm using the swift flavor.
Contents of ERROR-SWIFT_SWIFTLINT.log
:
Results of swiftlint linter (version 0.43.1)
See documentation on https://nvuillam.github.io/mega-linter/descriptors/swift_swiftlint/
-----------------------------------------------
❌ [ERROR] for workspace /github/workspace
Linter raw log:
Unable to find image 'norionomura/swiftlint:latest' locally
latest: Pulling from norionomura/swiftlint
34667c7e4631: Pulling fs layer
d18d76a881a4: Pulling fs layer
119c7358fbfc: Pulling fs layer
2aaf13f3eff0: Pulling fs layer
969975223755: Pulling fs layer
1ea85296b57d: Pulling fs layer
178f29677290: Pulling fs layer
5f015d65fccd: Pulling fs layer
969975223755: Waiting
1ea85296b57d: Waiting
178f29677290: Waiting
5f015d65fccd: Waiting
2aaf13f3eff0: Waiting
119c7358fbfc: Verifying Checksum
119c7358fbfc: Download complete
d18d76a881a4: Verifying Checksum
d18d76a881a4: Download complete
2aaf13f3eff0: Verifying Checksum
2aaf13f3eff0: Download complete
1ea85296b57d: Verifying Checksum
1ea85296b57d: Download complete
34667c7e4631: Verifying Checksum
34667c7e4631: Download complete
5f015d65fccd: Verifying Checksum
5f015d65fccd: Download complete
969975223755: Verifying Checksum
969975223755: Download complete
34667c7e4631: Pull complete
178f29677290: Verifying Checksum
178f29677290: Download complete
d18d76a881a4: Pull complete
119c7358fbfc: Pull complete
2aaf13f3eff0: Pull complete
969975223755: Pull complete
1ea85296b57d: Pull complete
178f29677290: Pull complete
5f015d65fccd: Pull complete
Digest: sha256:2b118a4b74998159c4aa3cd3ccf6d73074bec6ad70cfab0be28f4459754a0640
Status: Downloaded newer image for norionomura/swiftlint:latest
ErrCorrecting Swift files at paths /tmp/lint
or: No lintable files found at paths: '/tmp/lint'
To be honest, switft linting has been tested only from Mega-Linter test cases, so the error you see is probably a real bug and not a mistake from you
Do you have a public repo where I could reproduce the problem ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
not stale
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
@nvuillam this is still happening. I believe the problem is with the paths: SwiftLint lint --path '/tmp/lint'
this path should be the GitHub action repo workspace. Is there any way to change this path on the configurations?
Any suggestion around this? :)
It seems that swiftlint is the weak spot of MegaLinter... it indeed needs to be repaired, I'll try to succeed that someday:)
I just made an attempt... let's see what CI says ^^
Sure if you need any help. :) As far as I understand the problem is with the path passed down to SwiftLint SwiftLint lint --path '/tmp/lint'
Im not sure what is in this folder. But if you would change for the workspace path of the GitHub action it should work.
If you had an example of a full docker run command with swiftlint image it would help a lot :)
Well there is this GitHub action that I know works that also uses docker :).
https://github.com/norio-nomura/action-swiftlint
And this as the entrypoint: https://github.com/norio-nomura/action-swiftlint/blob/master/entrypoint.sh
But don't know if this can help you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.
This isn't stale and is still currently happening.
Reopened.... any help will be appreciated :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
If you think this issue should stay open, please remove the O: stale 🤖
label or comment on the issue.