We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cda6de3 commit 4a71560Copy full SHA for 4a71560
checkstyle/checks/LeftCurlyCheck.hx
@@ -197,10 +197,12 @@ class LeftCurlyCheck extends Check {
197
@SuppressWarnings("checkstyle:BlockFormat")
198
function checkLeftCurly(line:String, pos:Position) {
199
var lineLength:Int = line.length;
200
- line = StringTools.trim(line);
201
202
- var curlyAtEOL:Bool = ~/^.+\{\}?([ \t]*|[ \t]*\/\/.*)$/.match(line);
203
- var curlyOnNL:Bool = ~/^\{\}?/.match(line);
+ // must have at least one non whitespace character before curly
+ // and only whitespace, } or // + comment after curly
+ var curlyAtEOL:Bool = ~/^\s*\S.*\{\}?\s*(|\/\/.*)$/.match(line);
204
+ // must have only whitespace before curly
205
+ var curlyOnNL:Bool = ~/^\s*\{\}?/.match(line);
206
207
try {
208
if (curlyAtEOL) {
0 commit comments