Skip to content

Commit

Permalink
Better rules for removing of empty lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
Konard committed Mar 17, 2020
1 parent 7d4e20f commit a126a28
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,12 @@ public class CSharpToCppTransformer : TextTransformer
// [Fact]
//
(new Regex(@"(?<firstNewLine>\r?\n|\A)(?<indent>[\t ]+)\[[a-zA-Z0-9]+(\((?<expression>((?<parenthesis>\()|(?<-parenthesis>\))|[^()\r\n]*)+)(?(parenthesis)(?!))\))?\][ \t]*(\r?\n\k<indent>)?"), "${firstNewLine}${indent}", 5),
// \n ... namespace
// namespace
(new Regex(@"(\S[\r\n]{1,2})?[\r\n]+namespace"), "$1namespace", 0),
// \n ... class
// class
(new Regex(@"(\S[\r\n]{1,2})?[\r\n]+class"), "$1class", 0),
// \A \n ... namespace
// \Anamespace
(new Regex(@"(\A)(\r?\n)+namespace"), "$1namespace", 0),
// \A \n ... class
// \Aclass
(new Regex(@"(\A)(\r?\n)+class"), "$1class", 0),
// \n\n\n
// \n\n
(new Regex(@"\r?\n[ \t]*\r?\n[ \t]*\r?\n"), Environment.NewLine + Environment.NewLine, 50),
Expand Down

0 comments on commit a126a28

Please sign in to comment.