Skip to content

Commit

Permalink
✅ Prepare basic tests for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
David Sucharda committed Apr 11, 2022
1 parent b59949d commit b4bc047
Show file tree
Hide file tree
Showing 5 changed files with 171 additions and 300 deletions.
4 changes: 2 additions & 2 deletions lib/logging_lint/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class DangerLoggingLint < Plugin
# An attribute that you can read/write from your Dangerfile
#
# @return [Array<String>]
attr_accessor :my_attribute
attr_accessor :log_levels

# A method that you can call from your Dangerfile
# @return [Array<String>]
#
def warn_on_mondays
def lint
warn "Trying to merge code on a Monday" if Date.today.wday == 1
end
end
Expand Down
74 changes: 74 additions & 0 deletions spec/fixtures/ModifiedFile.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package cz.eman.logging.lint

class ModifiedFile {

fun runLogDebug() {
logDebug { "Log debug" }
logDebug("Log debug")
logDebug { "Log debug $var" }
logDebug("Log debug $var")
logDebug {
"Log debug"
}
logDebug(
"Log debug"
)
logDebug {
"Log debug $var"
}
logDebug(
"Log debug $var"
)
logDebug {
"Log debug"
+"Second line"
}
logDebug(
"Log debug"
+ "Second line"
)
logDebug {
"Log debug"
+"Second line $var"
}
logDebug(
"Log debug"
+ "Second line $var"
)
}

fun runLogInfo() {
logInfo { "Log debug" }
logInfo("Log debug")
logInfo { "Log debug $var" }
logInfo("Log debug $var")
logInfo {
"Log debug"
}
logInfo(
"Log debug"
)
logInfo {
"Log debug $var"
}
logInfo(
"Log debug $var"
)
logInfo {
"Log debug"
+"Second line"
}
logInfo(
"Log debug"
+ "Second line"
)
logInfo {
"Log debug"
+"Second line $var"
}
logInfo(
"Log debug"
+ "Second line $var"
)
}
}
74 changes: 74 additions & 0 deletions spec/fixtures/NewFile.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package cz.eman.logging.lint

class NewFile {

fun runLogDebug() {
logDebug { "Log debug" }
logDebug("Log debug")
logDebug { "Log debug $var" }
logDebug("Log debug $var")
logDebug {
"Log debug"
}
logDebug(
"Log debug"
)
logDebug {
"Log debug $var"
}
logDebug(
"Log debug $var"
)
logDebug {
"Log debug"
+"Second line"
}
logDebug(
"Log debug"
+ "Second line"
)
logDebug {
"Log debug"
+"Second line $var"
}
logDebug(
"Log debug"
+ "Second line $var"
)
}

fun runLogInfo() {
logInfo { "Log debug" }
logInfo("Log debug")
logInfo { "Log debug $var" }
logInfo("Log debug $var")
logInfo {
"Log debug"
}
logInfo(
"Log debug"
)
logInfo {
"Log debug $var"
}
logInfo(
"Log debug $var"
)
logInfo {
"Log debug"
+"Second line"
}
logInfo(
"Log debug"
+ "Second line"
)
logInfo {
"Log debug"
+"Second line $var"
}
logInfo(
"Log debug"
+ "Second line $var"
)
}
}
Loading

0 comments on commit b4bc047

Please sign in to comment.