Commit Graph

13 Commits

Author SHA1 Message Date
swift-ci
fe1b506392 Merge remote-tracking branch 'origin/master' into master-next 2017-04-14 17:28:31 -07:00
Maxwell Swadling
93d485e4f7 Changed handleDiagnostic to take a format string and format args instead of the formatted string
This allows diagnostic consumers to modify the way formatting of diagnostics is performed.
rdar://problem/31305854
2017-04-14 11:28:04 -07:00
Bob Wilson
07019d964d Update Swift master-next after LLVM API change in r300135. 2017-04-13 12:30:04 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Daniel Duan
d0de084a79 [swift-format] add option to indent switch block
add a boolean option to indent switch's block:

```
// with -indent-switch-case
switch xyz {
  case .x:
    doSomething()
}
```

```
// without -indent-switch-case
switch xyz {
case .x:
  doSomething()
}
```
2016-11-03 19:48:41 -07:00
Daniel Martín
81f87e5e9d Remove dependency on clang::tooling::Replacement
Considering that formatting only affects a single compilation unit, and
that code formatting does not support line ranges yet, remove dependency
on clang::tooling::Replacement.

This fixes SR-2619.
2016-10-02 21:16:31 +02:00
Michael Gottesman
d9882893b9 [swift-format] Check the llvm::Error returned by clang::tooling::Replacements::add to prevent abort.
llvm::Error's destructor has an assert in it that it was checked for success or
failure. This patch puts in a quick check for failure and emits a message to
llvm::errs() and returns failure (which in this case is indicating by returning
true).

A first class diagnostic should be added here, but given that I am preparing for
a stable merge update on a quick time schedule, I did the easy thing (with
respect to the message).
2016-08-31 14:07:18 -07:00
Michael Gottesman
78cb79a34d [upstream-update] clang::tooling::Replacements::insert() => clang::tooling::Replacements::add()
This is just a rename.
2016-08-30 23:14:51 -07:00
Robert Widmann
4ccf6c98dc Merge pull request #4191 from danielmartin/swift-format-documentation
Add swift-format documentation
2016-08-12 07:32:20 -07:00
Daniel Martín
14741c40bc Add swift-format documentation
Also, rename some options to improve consistency across the rest of the
driver options.
2016-08-10 17:43:49 +02:00
Daniel Martín
6902d9220c Use UINT_MAX instead of a "magic" upper bound
If a line range is not set, create a line range over the unsigned type,
instead of setting an arbitrary limit. We're not probably going to ever
deal with such big files, though.
2016-08-10 13:08:18 +02:00
Daniel Martín
df15ec4f3b Swift-format driver tool
This driver tool formats Swift files or file ranges using some
parameters like tabs or spaces, tab width, or amount of spaces.
2016-08-08 11:07:15 +02:00