# Bugs Encountered

**URL:** <https://forums.swift.org/t/bugs-encountered/30734>\
**Category:** Swift Format\
**Tags:** bug\
**Created:** [November 13, 2019, 12:53am UTC](https://forums.swift.org/t/bugs-encountered/30734 "2019-11-13T00:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [November 13, 2019, 12:53am UTC](https://forums.swift.org/t/bugs-encountered/30734/1 "2019-11-13T00:53:20Z")

</div>

[bugs.swift.org](http://bugs.swift.org) seems to be down right now. (Well, I get “Service Temporarily Unavailable” anyway.)

So I’m listing these `swift-format` bugs here instead so that I don’t forget about them and end up with you missing out on the reports altogether. @allevato

They all occurred while using `fc5a3da1d5d03143d7a31b12514349e2bf1aba8f`, the state of `swift-5.1-branch` from November 7, 2019. I don’t have the development toolchain to test the bleeding edge, so some or all of these may have already been fixed, but here they are:

- `UseShorthandTypeNames` ends up changing some types when it attempts to contract them:

- `AlwaysUseLowerCamelCase` doesn’t seem to understand caseless characters.

- `UseLetInEveryBoundCaseVariable` is way out to lunch at times:

- So is `CaseIndentLevelEqualsSwitch`:

- `BlankLineBetweenMembers` isn’t consistent with its tranformations:

- `ValidateDocumentationComments` cannot handle named closure parameters:

In case any of these are only triggered due to something in the wider context, they are all from [this repository](https://github.com/SDGGiesbrecht/Workspace) at revision `91661a3adc3ae3cdddd259f7a0822b5a1ed1fd36`.

---

<div class="post-metadata">

**Author:** ![allevato](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/allevato/32/385_2.png) [@allevato](https://forums.swift.org/u/allevato)\
**Post date:** [November 13, 2019, 2:27am UTC](https://forums.swift.org/t/bugs-encountered/30734/2 "2019-11-13T02:27:08Z")

</div>

Thanks for reporting these—it's always great to have more cases to improve our test coverage. It looks like [bugs.swift.org](http://bugs.swift.org) is back up, so if you could file these under the swift-format component there, that would be really helpful to individually track them.

We (Google) use swift-format primarily in format mode rather than lint mode ("don't report issues, just fix them and move on"), so the linter is definitely known to be the weaker of the two. We need to improve the testing infrastructure around lint mode; right now we just verify whether or not diagnostics are emitted, but not where, and expressing the assertions is a bit awkward.

To throw in some additional context on some of these:

> [@SDGGiesbrecht](#):
>
> `CaseIndentLevelEqualsSwitch`

Hmm, this rule should just be deleted. Indentation solely the purview of the pretty-printer now.

> [@SDGGiesbrecht](#):
>
> `BlankLineBetweenMembers` isn’t consistent with its tranformations:

Is there a comment preceding the first of those declarations (possibly with blank lines intervening)? If so, that's a known issue.

> [@SDGGiesbrecht](#):
>
> `ValidateDocumentationComments` cannot handle named closure parameters [...] Its message is also hard to understand at times:

We have a lot of improvements planned around our handling of doc comments; the current implementation needs to be replaced using the same Markdown logic used inside the compiler itself. The error's location is currently wrong because we just use the syntax node location, and there's not currently an API to get the location of a specific _trivia piece_ of a syntax node, which I'd like to add to SwiftSyntax.

---

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [November 13, 2019, 3:10am UTC](https://forums.swift.org/t/bugs-encountered/30734/3 "2019-11-13T03:10:53Z")

</div>

SR‐11771–11773

I didn’t bother reporting the ones you said will be deleted or completely reimplemented.
