Skip to content

Commit 6b2a6d7

Browse files
committed
Fix swiftlint error that is unable to find lintable swift files
- Update swiftlint documentation - Update to use swiftlint's Docker image Fixes oxsecurity#440
1 parent 7d5af4e commit 6b2a6d7

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
2121
Learn more about context on [GH-4328](https://github.com/oxsecurity/megalinter/issues/4328)
2222

2323
- Fixes
24+
- [swiftlint](https://github.com/realm/SwiftLint) Fix swiftlint error where linter is unable to find lintable files. Fixes [#440](https://github.com/oxsecurity/megalinter/issues/440).
2425

2526
- Reporters
2627

docs/descriptors/swift_swiftlint.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ description: How to use swiftlint (configure, ignore files, ignore errors, help
1111

1212
- Version in MegaLinter: **0.57.1**
1313
- Visit [Official Web Site](https://github.com/realm/SwiftLint#readme){target=_blank}
14-
- Docker image: [norionomura/swiftlint:latest](https://hub.docker.com/r/norionomura/swiftlint){target=_blank}
15-
- arguments: `-v {{WORKSPACE}}:/tmp/lint:rw`
14+
- Docker image: [ghcr.io/realm/swiftlint:latest](https://hub.docker.com/r/ghcr.io/realm/swiftlint){target=_blank}
15+
- arguments: `-v {{WORKSPACE}}:/tmp/lint:rw -w /tmp/lint`
1616
- See [How to configure swiftlint rules](https://github.com/realm/SwiftLint#configuration){target=_blank}
1717
- See [How to disable swiftlint rules in files](https://github.com/realm/SwiftLint#disable-rules-in-code){target=_blank}
1818
- See [Index of problems detected by swiftlint](https://realm.github.io/SwiftLint/rule-directory.html){target=_blank}
@@ -82,11 +82,11 @@ swiftlint is called once on the whole project directory (`project` CLI lint mode
8282
### Example calls
8383

8484
```shell
85-
docker run -v /tmp/lint:/tmp/lint:rw norionomura/swiftlint:latest swiftlint lint --path /tmp/lint --strict
85+
docker run -v /tmp/lint:/tmp/lint:rw ghcr.io/realm/swiftlint:latest swiftlint --strict
8686
```
8787

8888
```shell
89-
docker run -v /tmp/lint:/tmp/lint:rw norionomura/swiftlint:latest swiftlint --fix --path /tmp/lint --strict
89+
docker run -v /tmp/lint:/tmp/lint:rw ghcr.io/realm/swiftlint:latest swiftlint --fix --strict
9090
```
9191

9292

megalinter/descriptors/swift.megalinter-descriptor.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@ linters:
1919
cli_lint_extra_args:
2020
- "lint"
2121
cli_lint_extra_args_after:
22-
- "/tmp/lint"
2322
- "--strict"
2423
cli_lint_fix_arg_name: "--fix"
2524
cli_lint_fix_remove_args:
2625
- "lint"
27-
cli_docker_image: norionomura/swiftlint
26+
cli_docker_image: ghcr.io/realm/swiftlint
2827
cli_docker_args:
2928
- "-v"
3029
- "{{WORKSPACE}}:/tmp/lint:rw"
30+
- "-w"
31+
- "/tmp/lint"
3132
config_file_name: ".swiftlint.yml"
3233
cli_config_arg_name: ""
3334
cli_help_arg_name: "help"
3435
cli_version_arg_name: "version"
3536
cli_lint_errors_count: regex_number
3637
cli_lint_errors_regex: "Found ([0-9]+) violations"
3738
examples:
38-
- "docker run -v /tmp/lint:/tmp/lint:rw norionomura/swiftlint:latest swiftlint lint --path /tmp/lint --strict"
39-
- "docker run -v /tmp/lint:/tmp/lint:rw norionomura/swiftlint:latest swiftlint --fix --path /tmp/lint --strict"
39+
- "docker run -v /tmp/lint:/tmp/lint:rw ghcr.io/realm/swiftlint:latest swiftlint --strict"
40+
- "docker run -v /tmp/lint:/tmp/lint:rw ghcr.io/realm/swiftlint:latest swiftlint --fix --strict"
4041
ide:
4142
atom:
4243
- name: linter-swiftlint

0 commit comments

Comments
 (0)