realm / realm/SwiftLint

Enable Autocorrect Option in Xcode Build Tool Plugin

Open
#5,378 0 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Describe the bug

I am currently utilizing SwiftLint as a Build Tool Plugin in Xcode. While the linting functionality works as expected, I noticed that the autocorrect feature is not available in this integration mode. This seems to limit the usability of SwiftLint, particularly in streamlining the code correction process during the build phase.

I am aware that running swiftlint autocorrect as part of the build script can lead to issues with Xcode's new build system and parallel tasks, such as the error "file was modified during build". However, it would be highly beneficial to have an option to enable autocorrect, either as a compiler flag, build setting, or through an environment variable, to ensure code corrections are made before the build process and not in parallel with other tasks.

This feature would greatly enhance SwiftLint's integration with Xcode, allowing for a more automated and efficient code review and correction process during development.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting SwiftLint's Xcode Build Tool Plugin integration and the existing swiftlint autocorrect build-script behavior. Determine how an autocorrect option could run before parallel build tasks, then define the affected entry points and tests; the issue provides no file names or acceptance criteria for confirming completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.