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

SwiftLint plugin's suggested config starts Linux binary on x86_64 Mac OS machine #5954

Closed
2 tasks done
zbynek opened this issue Jan 13, 2025 · 1 comment · Fixed by #5957
Closed
2 tasks done

SwiftLint plugin's suggested config starts Linux binary on x86_64 Mac OS machine #5954

zbynek opened this issue Jan 13, 2025 · 1 comment · Fixed by #5957
Labels
bug Unexpected and reproducible misbehavior. documentation Issues related to documentation, either from the tooling side or content-wise.
Milestone

Comments

@zbynek
Copy link

zbynek commented Jan 13, 2025

New Issue Checklist

Bug Description

When using the config from

SWIFTLINT_CMD=$(ls "$SWIFT_PACKAGE_DIR"/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/swiftlint-*/bin/swiftlint | head -n 1)
,
running SwiftLint results in execution of .../SwiftLintBinary.artifactbundle/swiftlint-0.58.0-linux-gnu/bin/swiftlint which fails to run on Mac OS because the * in SWIFTLINT_CMD matches both Linux and MacOS binaries.

Environment

  • SwiftLint version: 0.58
  • Xcode version: Xcode 16.0, Build version 16A242d
  • Installation method: Tuist
let packages: [Package] = [
    .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", from: "0.56.1")
]
Config file (irrelevant in this case)
disabled_rules: # rule identifiers turned on by default to exclude from running
- line_length
- file_length
- type_body_length
- function_body_length
- identifier_name
- type_name
- large_tuple
- nesting
- function_parameter_count
- cyclomatic_complexity
- redundant_discardable_let
- force_cast # re-enable at some point
- comment_spacing
- notification_center_detachment
- for_where
- trailing_whitespace
- xctfail_message
- unused_optional_binding
- private_over_fileprivate
- no_fallthrough_only
- inclusive_language

opt_in_rules: # some rules are turned off by default, so you need to opt-in
- empty_count: warning
- unused_import
- sorted_imports

#included: # paths to include during linting. `--path` is ignored if present.
#  - Source

excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
- Tuist
- .gems

# configurable rules can be customized from this configuration file
# binary rules can set their severity level
#force_cast: warning # implicitly
force_try:
  severity: warning # explicitly

shorthand_operator:
  severity: warning

# trailing_whitespace: 
#   ignores_empty_lines: true
  
#line_length: 110

Related to #5866

Suggestions

Updating the README and maybe mentioning the necessary config change in GitHub Releases would be appreciated.

@zbynek zbynek changed the title Linux version starts on x86_64 Mac OS machine SwiftLint plugin's suggested config starts Linux binary on x86_64 Mac OS machine Jan 13, 2025
@SimplyDanny SimplyDanny added this to the 0.58.1 milestone Jan 13, 2025
@SimplyDanny SimplyDanny added bug Unexpected and reproducible misbehavior. documentation Issues related to documentation, either from the tooling side or content-wise. labels Jan 13, 2025
@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Jan 13, 2025

You need to change the path to:

"$SWIFT_PACKAGE_DIR"/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/swiftlint-*-macos/bin/swiftlint`

I'll also update the README and mention the change specifically in the release notes for 0.58.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior. documentation Issues related to documentation, either from the tooling side or content-wise.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants