This file contains hidden or 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
import org.apache.poi.ss.usermodel.Cell; | |
import org.apache.poi.ss.usermodel.Row; | |
import org.apache.poi.ss.usermodel.Sheet; | |
import org.apache.poi.ss.usermodel.Workbook; | |
import org.apache.poi.ss.util.CellReference; | |
import org.apache.poi.xssf.streaming.SXSSFWorkbook; | |
import java.io.FileOutputStream | |
import java.io.File |
This file contains hidden or 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
var app = angular.module('DirectivesModule', []); | |
app.controller('CustomersController', ['$scope', function ($scope) { | |
var counter = 0; | |
$scope.customer = { | |
name: 'David', | |
street: '1234 Anywhere St.' | |
}; | |
$scope.customers = [{name:"Goliath",street:"Temple Mountain"}]; |
This file contains hidden or 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
/** | |
* Changes a case class Foo(_type: String) into case class Foo(`type`: String) | |
*/ | |
case class UseBackTicks(index: SemanticdbIndex) extends SemanticRule(index, "UseBackTicks") { | |
override def fix(ctx: RuleCtx): Patch = { | |
val reservedWords = Set( | |
// Scala | |
"abstract", "case", "catch", "class", "def", "do", "else", "extends", "false", "final", "finally", "for", "forSome", "if", "implicit", "import", "lazy", "match", "new", "null", "object", "override", "package", "private", "protected", "return", "sealed", "super", "this", "throw", "trait", "try", "true", "type", "val", "var", "while", "with", "yield", | |
// Scala-interop languages keywords |
This file contains hidden or 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
/** | |
* Changes a case class Foo() into case object Foo | |
*/ | |
case class EmptyCaseClassToObject(index: SemanticdbIndex) extends SemanticRule(index, "EmptyCaseClassToObject") { | |
val isEmptyCaseClass = (c: Defn.Class) => c.ctor.paramss.forall(_.isEmpty) && c.mods.nonEmpty | |
override def fix(ctx: RuleCtx): Patch = { | |
ctx.tree.collect { | |
case c @ Defn.Class(_) if isEmptyCaseClass(c) => |
This file contains hidden or 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
import scalafix._ | |
import scala.meta._ | |
import scala.meta.contrib._ | |
import scalafix.Patch | |
import scalafix.SemanticdbIndex | |
import scalafix.rule.RuleCtx | |
import scalafix.rule.SemanticRule | |
case class FinalCaseClass(index: SemanticdbIndex) extends SemanticRule(index, "FinalCaseClass") { |
This file contains hidden or 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
import scalafix._ | |
import scalafix.Patch | |
import scalafix.SemanticdbIndex | |
import scalafix.rule.RuleCtx | |
import scalafix.rule.SemanticRule | |
import scala.meta._ | |
import contrib._ | |
import scalafix.lint.LintMessage | |
case class SeqToList(index: SemanticdbIndex) extends SemanticRule(index, "SeqToList") { |