diff options
author | Martin Probst <martin@probst.io> | 2017-03-13 09:39:23 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2017-03-13 09:39:23 +0000 |
commit | 3d94569a359c6bb9972ea883d641190b081ffe8b (patch) | |
tree | bcf1e715822efc1a457646ab9afabfa07bfa0086 /lib/Format/Format.cpp | |
parent | 1f562e750841ffdb76b1444063f351a86f7a5ce5 (diff) | |
download | clang-3d94569a359c6bb9972ea883d641190b081ffe8b.tar.gz |
clang-format: [JS] do not wrap @see tags.
Summary:
@see is special among JSDoc tags in that it is commonly followed by URLs. The JSDoc spec suggests that users should wrap URLs in an additional {@link url...} tag (@see http://usejsdoc.org/tags-see.html), but this is very commonly violated, with @see being followed by a "naked" URL.
This change special cases all JSDoc lines that contain an @see not to be wrapped to account for that.
Reviewers: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D30883
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297607 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 07624620d0..9bb2a97ce5 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -624,8 +624,9 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) { GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty; GoogleStyle.AlwaysBreakBeforeMultilineStrings = false; GoogleStyle.BreakBeforeTernaryOperators = false; - // taze:, and @tag followed by { for a lot of JSDoc tags. - GoogleStyle.CommentPragmas = "(taze:|(@[A-Za-z_0-9-]+[ \\t]*{))"; + // taze:, @tag followed by { for a lot of JSDoc tags, and @see, which is + // commonly followed by overlong URLs. + GoogleStyle.CommentPragmas = "(taze:|(@[A-Za-z_0-9-]+[ \\t]*{)|@see)"; GoogleStyle.MaxEmptyLinesToKeep = 3; GoogleStyle.NamespaceIndentation = FormatStyle::NI_All; GoogleStyle.SpacesInContainerLiterals = false; |