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

Fix swiftlint #1757

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Salesforce linters: Switch sfdx-cli to @salesforce/cli
- Fixed issue with `actionlint` throwing an error on `if` statements in the generated workflow file
- Added default `.devskim.json` to mitigate errors introduced when no config exists
- Fix swiftlint --path argument by adding workspace

- Doc
- Display list of articles from newest to oldest
Expand Down
6 changes: 3 additions & 3 deletions megalinter/descriptors/swift.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ linters:
cli_lint_extra_args:
- "lint"
cli_lint_extra_args_after:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also update the examples in line 38?

- "--path"
- "/tmp/lint"
- "--strict"
cli_lint_fix_arg_name: "--fix"
cli_lint_fix_remove_args:
- "lint"
cli_docker_image: norionomura/swiftlint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use realm swiftlint's Docker image instead?

cli_docker_args:
- "-v"
- "{{WORKSPACE}}:/tmp/lint:rw"
- "$(pwd):$(pwd)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't have to change the /tmp/lint. Just update the working directory to point to /tmp/lint.

Example:

docker run --rm -v /github/workspace:/tmp/lint -w /tmp/lint ghcr.io/realm/swiftlint:latest swiftlint --strict

- "-w"
- "$(pwd)"
config_file_name: ".swiftlint.yml"
cli_config_arg_name: ""
cli_help_arg_name: "help"
Expand Down
Loading