Skip to content
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

Linting swift code does not work. Error: No lintable files found at paths: '/tmp/lint' #440

Closed
r3econ opened this issue Apr 29, 2021 · 22 comments · Fixed by #467 · May be fixed by #1757
Closed

Linting swift code does not work. Error: No lintable files found at paths: '/tmp/lint' #440

r3econ opened this issue Apr 29, 2021 · 22 comments · Fixed by #467 · May be fixed by #1757
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity

Comments

@r3econ
Copy link

r3econ commented Apr 29, 2021

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:

  1. Follow the quick start CLI to add mega-linter to the iOS Swift project
  2. Accept default values (except one case where you choose that it's a Swift project)
  3. Push to the repo, create a PR to trigger the GitHub Action
  4. See swift-lint error (not related to the codebase)

Expected behavior

  • swift-lint starts linting the code base.

Screenshots

Screenshot 2021-04-29 at 13 26 35

  • 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
@r3econ r3econ added the bug Something isn't working label Apr 29, 2021
@r3econ
Copy link
Author

r3econ commented May 10, 2021

Is there anyone able to help with this?

@nvuillam
Copy link
Member

@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 !

@r3econ
Copy link
Author

r3econ commented May 14, 2021

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?.

@nvuillam
Copy link
Member

nvuillam commented May 14, 2021

You could try to replace --fix by autocorrect in the swift descriptor cli_lint_fix_arg, maybe it would solve the issue

@nvuillam
Copy link
Member

@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 ?

@nvuillam nvuillam reopened this May 15, 2021
@r3econ
Copy link
Author

r3econ commented May 17, 2021

Thanks a lot! I tested, changed the action invocation in the workflow to use the latest tag like in the screenshot below.

Screenshot 2021-05-17 at 11 58 28

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'

@nvuillam
Copy link
Member

nvuillam commented May 17, 2021

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 ?

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jun 17, 2021
@github-actions github-actions bot closed this as completed Jul 1, 2021
@nvuillam
Copy link
Member

nvuillam commented Jul 1, 2021

not stale

@nvuillam nvuillam reopened this Jul 1, 2021
@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2021

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 1, 2021
@nvuillam nvuillam removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 1, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2021

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 1, 2021
@goncalo-frade-iohk
Copy link

@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?

@nvuillam nvuillam reopened this Aug 10, 2022
@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Aug 11, 2022
@goncalo-frade-iohk
Copy link

Any suggestion around this? :)

@nvuillam
Copy link
Member

It seems that swiftlint is the weak spot of MegaLinter... it indeed needs to be repaired, I'll try to succeed that someday:)

@nvuillam
Copy link
Member

I just made an attempt... let's see what CI says ^^

@goncalo-frade-iohk
Copy link

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.

@nvuillam
Copy link
Member

If you had an example of a full docker run command with swiftlint image it would help a lot :)

@goncalo-frade-iohk
Copy link

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.

goncalo-frade-iohk added a commit to input-output-hk/atala-prism-wallet-sdk-swift that referenced this issue Aug 19, 2022
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below.
While a solution is not provided we will go forward with having this swiftlint action and disable the
megalinter swiftlint process.
oxsecurity/megalinter#440
goncalo-frade-iohk added a commit to input-output-hk/atala-prism-wallet-sdk-swift that referenced this issue Aug 19, 2022
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below.
While a solution is not provided we will go forward with having this swiftlint action and disable the
megalinter swiftlint process.
oxsecurity/megalinter#440
goncalo-frade-iohk added a commit to input-output-hk/atala-prism-wallet-sdk-swift that referenced this issue Aug 19, 2022
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below.
While a solution is not provided we will go forward with having this swiftlint action and disable the
megalinter swiftlint process.
oxsecurity/megalinter#440

Fixes ATL-1640
goncalo-frade-iohk added a commit to input-output-hk/atala-prism-wallet-sdk-swift that referenced this issue Aug 19, 2022
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below.
While a solution is not provided we will go forward with having this swiftlint action and disable the
megalinter swiftlint process.
oxsecurity/megalinter#440

Fixes ATL-1640
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Sep 17, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2022
@keithrfung
Copy link

This isn't stale and is still currently happening.

@nvuillam nvuillam reopened this Jun 18, 2023
@nvuillam
Copy link
Member

Reopened.... any help will be appreciated :)

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jun 19, 2023
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Jul 19, 2023
@r3econ r3econ closed this as completed Jul 24, 2023
goncalo-frade-iohk added a commit to input-output-hk/atala-prism-wallet-sdk-swift that referenced this issue May 14, 2024
Megalinter doesnt work well with swiftlint. This issue has been reported in the ticket below.
While a solution is not provided we will go forward with having this swiftlint action and disable the
megalinter swiftlint process.
oxsecurity/megalinter#440

Fixes ATL-1640

Signed-off-by: goncalo-frade-iohk <goncalo.frade@iohk.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants