When using SwiftLint autocorrect and a file is corrected after building the app, the undo history of the corrected file is gone.
Environment
SwiftLint version 0.42.0
Installation method used: Homebrew
# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
- line_length
- todo
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- bak.swift # Exclude files with a wildcard
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 1 # only warning
max_length: # warning and error
warning: 50
error: 60
excluded: iPhone # excluded via string
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: 1
Xcode version Version 12.4 (12D4e) and 12.5 beta (12E5220o)
Create a SwiftUI project with only this code:
import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, world!")
.padding()
//Comment violation
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Setup the following as a build script:
if which swiftlint >/dev/null; then
swiftlint autocorrect && swiftlint
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
To reproduce the error, simply change a few things. Then run the app and the undo history will be gone.
Description of the bug
When using SwiftLint autocorrect and a file is corrected after building the app, the undo history of the corrected file is gone.
Environment
Create a SwiftUI project with only this code:
Setup the following as a build script:
To reproduce the error, simply change a few things. Then run the app and the undo history will be gone.