-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from isc-egabhart/main
CodeTidy with JSON linting
- Loading branch information
Showing
29 changed files
with
1,825 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
tests/_reference/after/TestPackage.BlockCommentTestClass.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Class TestPackage.BlockCommentTestClass | ||
{ | ||
|
||
Method BlockCommentTest() | ||
{ | ||
/* | ||
Do not change | ||
my indentation | ||
even if inconsistent | ||
or containing "code" | ||
set foo = "bar" | ||
if (foo = "bar") { | ||
do thing | ||
} | ||
*/ | ||
|
||
set foo = "bar" | ||
|
||
/* Or even if | ||
there are | ||
multiple blocks, | ||
multiple openings /* | ||
or misaligned closings | ||
within the block | ||
*/ | ||
} | ||
|
||
} | ||
|
83 changes: 83 additions & 0 deletions
83
tests/_reference/after/TestPackage.HTMLIndentTestClass.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Class TestPackage.HTMLIndentTestClass | ||
{ | ||
|
||
Method HTMLGoodIndent() | ||
{ | ||
&html< | ||
<html> | ||
<head></head> | ||
<body></body> | ||
> | ||
} | ||
|
||
Method HTMLBlockIndent() | ||
{ | ||
&html< | ||
<html> | ||
<head></head> | ||
<body></body> | ||
> | ||
} | ||
|
||
Method HTMLBadIndent() | ||
{ | ||
&html< | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
</body> | ||
> | ||
} | ||
|
||
Method HTMLIfBlock() | ||
{ | ||
if 1 { | ||
&html< | ||
<html> | ||
<head></head> | ||
<body></body> | ||
> | ||
} | ||
} | ||
|
||
Method HTMLUntidyIfBlock() | ||
{ | ||
if 1 { | ||
if 1 { | ||
&html< | ||
<html> | ||
<head></head> | ||
<body></body> | ||
> | ||
} else { | ||
&html< | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
</body> | ||
> | ||
} | ||
} | ||
} | ||
|
||
Method HTMLOneLine() | ||
{ | ||
&html<<a href='url'>Link</a>> | ||
} | ||
|
||
Method HTMLMarker() | ||
{ | ||
&htmlabc< | ||
<html> | ||
<body> | ||
4 > 3 | ||
5>>7 >>> | ||
4 > 2 >> | ||
</body> | ||
>cba | ||
} | ||
|
||
} | ||
|
110 changes: 110 additions & 0 deletions
110
tests/_reference/after/TestPackage.JSIndentTestClass.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
Class TestPackage.JSIndentTestClass | ||
{ | ||
|
||
Method JavaScriptTidy() | ||
{ | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
// This is a comment | ||
return true | ||
} | ||
> | ||
} | ||
|
||
Method JavaScriptUnindent() | ||
{ | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
// This is a comment | ||
return true | ||
} | ||
> | ||
} | ||
|
||
Method JavaScriptNeedsIndent() | ||
{ | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
// This is a comment | ||
return true | ||
} | ||
> | ||
} | ||
|
||
Method JavaScriptTwoBlocks() | ||
{ | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
// This is a comment | ||
return true | ||
} | ||
> | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
// This is a comment | ||
return true | ||
} | ||
> | ||
} | ||
|
||
Method JavaScriptOneLine() | ||
{ | ||
&javascript<function foo(bar) {return true}> | ||
} | ||
|
||
Method JavaScriptVeryMessy() | ||
{ | ||
if 1 { | ||
&javascript< | ||
function foo(bar) | ||
{ | ||
return true | ||
} | ||
|
||
|
||
> | ||
} | ||
} | ||
|
||
Method JavaScriptMarker() | ||
{ | ||
&javascript123< | ||
function foo(bar) | ||
{ | ||
if (6 > 5) { | ||
return True | ||
} | ||
} | ||
>321 | ||
} | ||
|
||
Method JavaScriptAbbrev() | ||
{ | ||
if 1 { | ||
&js< | ||
function foo(bar) | ||
{ | ||
return true | ||
} | ||
|
||
|
||
> | ||
} | ||
|
||
&jsabc< | ||
function foo(bar) | ||
{ | ||
if (6 > 5) { | ||
return True | ||
} | ||
} | ||
>cba | ||
} | ||
|
||
} | ||
|
15 changes: 15 additions & 0 deletions
15
tests/_reference/after/TestPackage.JSONBracketMatching.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class TestPackage.JSONBracketMatching | ||
{ | ||
|
||
ClassMethod TestJSONArray() As %Status | ||
{ | ||
set example = [{ | ||
"foo":"bar" | ||
}, | ||
{ | ||
"bar":"foo" | ||
}] | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class TestPackage.JSONBracketMixed | ||
{ | ||
|
||
ClassMethod TestJSONArray() As %Status | ||
{ | ||
set example = [{ | ||
"foo":"bar" | ||
}, | ||
{ | ||
"bar":"foo" | ||
}] | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class TestPackage.JSONBracketOneLine | ||
{ | ||
|
||
ClassMethod TestJSONArray() As %Status | ||
{ | ||
set example = [{ | ||
"foo":"bar" | ||
}, | ||
{ | ||
"bar":"foo" | ||
}] | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Class TestPackage.JSONIndent | ||
{ | ||
|
||
ClassMethod TestJSONArray() As %Status | ||
{ | ||
set example = [{ | ||
"foo":"bar" | ||
}, | ||
{ | ||
"bar":"foo" | ||
}] | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.