-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Save in diktat smoke tests #1060
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7bbb809
Added Save in diktat smoke tests:
Cheshiriks 1c17a11
Added Save in diktat smoke tests:
Cheshiriks ef40888
Added Save in diktat smoke tests:
Cheshiriks ed7a8be
Merge branch 'master' into feature/run_tests_using_save
Cheshiriks 85033ce
Added Save in diktat smoke tests:
Cheshiriks 8795cc1
Added Save in diktat smoke tests:
Cheshiriks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[general] | ||
execCmd="./ktlint -R diktat-1.0.0-rc.2.jar" | ||
tags = ["smokeTest"] | ||
description = "SmokeTest" | ||
suiteName = "SmokeTest" | ||
|
||
["fix and warn"] | ||
["fix and warn".fix] | ||
execFlags="-F" | ||
["fix and warn".warn] | ||
actualWarningsPattern="(\\w+\\..+):(\\d+):(\\d+): (\\[.*\\].*)$" |
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 |
---|---|---|
|
@@ -5,4 +5,3 @@ import kotlinx.browser.document | |
fun main() { | ||
(document.getElementById("myId") as HTMLElement).click() | ||
} | ||
|
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
6 changes: 5 additions & 1 deletion
6
diktat-rules/src/test/resources/test/smoke/src/main/kotlin/DefaultPackageExpected.kt
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
@file:Suppress( | ||
"PACKAGE_NAME_MISSING", | ||
"PACKAGE_NAME_INCORRECT_PATH", | ||
"PACKAGE_NAME_INCORRECT_PREFIX" | ||
) | ||
|
||
/** | ||
* Dolor sit amet | ||
*/ | ||
class Example | ||
|
6 changes: 5 additions & 1 deletion
6
diktat-rules/src/test/resources/test/smoke/src/main/kotlin/DefaultPackageTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,3 @@ fun foo(x : Int | |
) | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -41,4 +41,3 @@ class Example { | |
bar(x, y) | ||
) | ||
} | ||
|
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 |
---|---|---|
|
@@ -50,4 +50,3 @@ private fun foo(node: ASTNode) { | |
|
||
setOf<Object>(IOException(), Properties(), LoggerFactory()) | ||
} | ||
|
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 |
---|---|---|
|
@@ -68,4 +68,3 @@ fun mains() { | |
} | ||
httpClient.doRequest() | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,3 @@ package org.cqfn.diktat | |
class Some { | ||
val config = Config() | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ fun foo() { | |
doSmth() | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -19,4 +19,3 @@ fun foo1(bar: Bar): Baz { | |
fun foo2(bar: Bar): Baz { | ||
// placeholder | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,3 @@ import org.gradle.kotlin.dsl.plugins | |
plugins { | ||
kotlin("jvm") | ||
} | ||
|
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 |
---|---|---|
|
@@ -17,4 +17,3 @@ run { | |
also { | ||
println("a") | ||
} | ||
|
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 |
---|---|---|
|
@@ -16,4 +16,3 @@ run { | |
also { | ||
println("a") | ||
} | ||
|
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -40,14 +40,22 @@ class FileComparator { | |||||||||
* @return true in case files are different | ||||||||||
* false - in case they are equals | ||||||||||
*/ | ||||||||||
@Suppress("ReturnCount", "FUNCTION_BOOLEAN_PREFIX") | ||||||||||
@Suppress( | ||||||||||
"ReturnCount", | ||||||||||
"FUNCTION_BOOLEAN_PREFIX", | ||||||||||
"TOO_LONG_FUNCTION") | ||||||||||
fun compareFilesEqual(): Boolean { | ||||||||||
try { | ||||||||||
val expect = readFile(expectedResultFile.absolutePath) | ||||||||||
if (expect.isEmpty()) { | ||||||||||
return false | ||||||||||
} | ||||||||||
val patch = diff(expect, actualResultList) | ||||||||||
val regex = (".*// ;warn:(\\d+):(\\d+): (.*)").toRegex() | ||||||||||
val expectWithoutWarn = expect.filter { line -> | ||||||||||
!line.contains(regex) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||||||||||
} | ||||||||||
val patch = diff(expectWithoutWarn, actualResultList) | ||||||||||
|
||||||||||
if (patch.deltas.isEmpty()) { | ||||||||||
return true | ||||||||||
} | ||||||||||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we were planning to execute SAVE in CI too?