Skip to content

Commit

Permalink
refactor(core): fix klint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsph committed Sep 5, 2023
1 parent 08e5a7b commit 1f98caf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ data class CellResultData(
@get:JsonIgnore // Not return this information to the user
val formula: String?,
@get:JsonIgnore // Not return this information to the user
val solution: Cell?,
val solution: Cell?
) {
constructor(cell: Cell, cellResult: CellResult?) : this(
cell.cell,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package de.thm.ii.fbs.utils.v2.spreadsheet

Check warning on line 1 in modules/fbs-core/api/src/main/kotlin/de/thm/ii/fbs/utils/v2/spreadsheet/SpreadsheetEvaluator.kt

View workflow job for this annotation

GitHub Actions / fbs-core.api / Lint

File must end with a newline (\n)

import org.apache.poi.ss.usermodel.CellType
import org.apache.poi.ss.usermodel.FormulaEvaluator
import org.apache.poi.ss.usermodel.Workbook
import org.slf4j.LoggerFactory

class SpreadsheetEvaluator {
companion object {
private val logger = LoggerFactory.getLogger(SpreadsheetEvaluator::class.java)

fun evaluateAll(workbook: Workbook, evaluator: FormulaEvaluator) {
for (sheet in workbook.sheetIterator()) {
for (row in sheet.rowIterator()) {
for (cell in row.cellIterator()) {
if (cell.cellType == CellType.FORMULA) {
try {
evaluator.evaluateFormulaCell(cell)
} catch (e: Exception) {
// Ignore Evaluation errors
}
}
}
}
}
}
}
}

0 comments on commit 1f98caf

Please sign in to comment.