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

[SR-12785] swift-format -m lint has zero exit code after identifying style violations #327

Closed
tcldr opened this issue May 11, 2020 · 3 comments
Labels
bug Something isn't working swift-format

Comments

@tcldr
Copy link

tcldr commented May 11, 2020

Previous ID SR-12785
Radar None
Original Reporter @tcldr
Type Bug

Attachment: Download

Environment

swift-format swift-5.2-branch
Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
Target: x86_64-apple-darwin19.4.0

Additional Detail from JIRA
Votes 0
Component/s swift-format
Labels Bug
Assignee None
Priority Medium

md5: 309a6cbb23c057de7ad21f94da974b48

Issue Description:

It seems that swift-format should set a non-zero Xcode when it identifies a style violation.

However, violations are returned with a zero error which may complicate integration with other parts of a build pipeline:

$ swift-format -m lint Test.swift
/Users/tcldr/Desktop/Test.swift:1:1: warning: [Indentation] remove all leading whitespace
/Users/tcldr/Desktop/Test.swift:1:8: warning: [Spacing]: remove 1 space
/Users/tcldr/Desktop/Test.swift:1:18: warning: [Spacing]: remove 3 spaces
$ echo $?
0
@swift-ci
Copy link

Comment by Jorge Cohen (JIRA)

Wanted to have look at this, but unfortunately am not able to reproduce. @tcldr could you please attach the test file you were using?

@tcldr
Copy link
Author

tcldr commented May 12, 2020

Sure – I've added as an attachment.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@allevato
Copy link
Collaborator

This was fixed by the addition of the --strict flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working swift-format
Projects
None yet
Development

No branches or pull requests

3 participants