Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Delete outdated scalastyle configuration comments from source
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-magyar committed Jul 14, 2020
1 parent 82956e4 commit 63bfb32
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 24 deletions.
2 changes: 0 additions & 2 deletions src/main/scala/firrtl/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ sealed abstract class CircuitForm(private val value: Int) extends Ordered[Circui
def outputSuffix: String
}

// scalastyle:off magic.number
// These magic numbers give an ordering to CircuitForm
/** Chirrtl Form
*
Expand Down Expand Up @@ -191,7 +190,6 @@ final case object UnknownForm extends CircuitForm(-1) {

val outputSuffix: String = ".unknown.fir"
}
// scalastyle:on magic.number

// Internal utilities to keep code DRY, not a clean interface
private[firrtl] object Transform {
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/firrtl/Driver.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ object Driver {
* @param optionsManager use optionsManager config to load annotation files
* @return Annotations read from files
*/
//scalastyle:off cyclomatic.complexity method.length
def getAnnotations(
optionsManager: ExecutionOptionsManager with HasFirrtlOptions
): Seq[Annotation] = {
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/firrtl/annotations/Annotation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ private[firrtl] object LegacyAnnotation {
import firrtl.passes.clocklist._

// Attempt to convert common Annotations and error on the rest of old-style build-in annotations
// scalastyle:off
def convertLegacyAnno(anno: LegacyAnnotation): Annotation = anno match {
// All old-style Emitter annotations are illegal
case LegacyAnnotation(_,_,"emitCircuit") => errorIllegalAnno("EmitCircuitAnnotation")
Expand Down Expand Up @@ -236,7 +235,6 @@ private[firrtl] object LegacyAnnotation {
OptimizableExtModuleAnnotation(c)
case other => other
}
// scalastyle:on
def convertLegacyAnnos(annos: AnnotationSeq): AnnotationSeq = {
var warned: Boolean = false
annos.map {
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/firrtl/ir/IR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ case object NoInfo extends Info {
}
case class FileInfo(info: StringLit) extends Info {
override def toString: String = " @[" + info.serialize + "]"
//scalastyle:off method.name
def ++(that: Info): Info = if (that == NoInfo) this else MultiInfo(Seq(this, that))
}
case class MultiInfo(infos: Seq[Info]) extends Info {
Expand All @@ -38,7 +37,6 @@ case class MultiInfo(infos: Seq[Info]) extends Info {
if (parts.nonEmpty) parts.map(_.serialize).mkString(" @[", " ", "]")
else ""
}
//scalastyle:off method.name
def ++(that: Info): Info = if (that == NoInfo) this else MultiInfo(infos :+ that)
}
object MultiInfo {
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/firrtl/ir/Serializer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ object Serializer {

private def s(str: StringLit)(implicit b: StringBuilder, indent: Int): Unit = b ++= str.serialize

//scalastyle:off cyclomatic.complexity
private def s(node: Expression)(implicit b: StringBuilder, indent: Int): Unit = node match {
case Reference(name, _, _, _) => b ++= name
case DoPrim(op, args, consts, _) =>
Expand All @@ -78,7 +77,6 @@ object Serializer {
case firrtl.EmptyExpression => b ++= "EMPTY"
}

//scalastyle:off cyclomatic.complexity method.length
private def s(node: Statement)(implicit b: StringBuilder, indent: Int): Unit = node match {
case DefNode(info, name, value) => b ++= "node " ; b ++= name ; b ++= " = " ; s(value) ; s(info)
case Connect(info, loc, expr) => s(loc) ; b ++= " <= " ; s(expr) ; s(info)
Expand Down
9 changes: 0 additions & 9 deletions src/main/scala/firrtl/ir/StructuralHash.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ object StructuralHash {
// see: https://docs.oracle.com/javase/7/docs/api/java/security/MessageDigest.html
private val SHA256 = "SHA-256"

//scalastyle:off cyclomatic.complexity
private def hash(node: FirrtlNode, h: Hasher, rename: String => String): Unit = node match {
case n : Expression => new StructuralHash(h, rename).hash(n)
case n : Statement => new StructuralHash(h, rename).hash(n)
Expand All @@ -74,7 +73,6 @@ object StructuralHash {
case n : Circuit => hashCircuit(n, h, rename)
case n : StringLit => h.update(n.toString)
}
//scalastyle:on cyclomatic.complexity

private def hashModuleAndPortNames(m: DefModule, h: Hasher, rename: String => String): Unit = {
val sh = new StructuralHash(h, rename)
Expand Down Expand Up @@ -190,8 +188,6 @@ class StructuralHash private(h: Hasher, renameModule: String => String) {
@inline private def hash(i: BigDecimal): Unit = h.update(i)
@inline private def hash(s: String): Unit = h.update(s)

//scalastyle:off magic.number
//scalastyle:off cyclomatic.complexity
private def hash(node: Expression): Unit = node match {
case Reference(name, _, _, _) => id(0) ; n(name)
case DoPrim(op, args, consts, _) =>
Expand Down Expand Up @@ -227,9 +223,7 @@ class StructuralHash private(h: Hasher, renameModule: String => String) {
case firrtl.VRandom(width) => id(13) ; hash(width)
// ids 14 ... 19 are reserved for future Expression nodes
}
//scalastyle:on cyclomatic.complexity

//scalastyle:off cyclomatic.complexity method.length
private def hash(node: Statement): Unit = node match {
// all info fields are ignore
case DefNode(_, name, value) => id(20) ; n(name) ; hash(value)
Expand Down Expand Up @@ -282,7 +276,6 @@ class StructuralHash private(h: Hasher, renameModule: String => String) {
id(36) ; hash(StructuralHash.verificationOp(op)) ; hash(clk) ; hash(pred) ; hash(en) ; hash(msg.string)
// ids 37 ... 39 are reserved for future Statement nodes
}
//scalastyle:on cyclomatic.complexity method.length

// ReadUnderWrite is never used in place of a FirrtlNode and thus we can start a new id namespace
private def hash(ruw: ReadUnderWrite.Value): Unit = ruw match {
Expand Down Expand Up @@ -316,7 +309,6 @@ class StructuralHash private(h: Hasher, renameModule: String => String) {
id(48) ; hash(node.flip) ; hash(node.tpe)
}

//scalastyle:off cyclomatic.complexity
private def hash(node: Type): Unit = node match {
// Types
case UIntType(width: Width) => id(50) ; hash(width)
Expand All @@ -332,7 +324,6 @@ class StructuralHash private(h: Hasher, renameModule: String => String) {
case IntervalType(lower, upper, point) => id(60) ; hash(lower) ; hash(upper) ; hash(point)
// ids 61 ... 65 are reserved for future Type nodes
}
//scalastyle:on cyclomatic.complexity

private def hash(node: Direction): Unit = node match {
case Input => id(66)
Expand Down
2 changes: 0 additions & 2 deletions src/main/scala/firrtl/options/StageUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ object StageUtils {
/** Print a warning message (in yellow)
* @param message error message
*/
//scalastyle:off regex
def dramaticWarning(message: String): Unit = {
println(Console.YELLOW + "-"*78)
println(s"Warning: $message")
Expand All @@ -19,7 +18,6 @@ object StageUtils {
* @param message error message
* @note This does not stop the Driver.
*/
//scalastyle:off regex
def dramaticError(message: String): Unit = {
println(Console.RED + "-"*78)
println(s"Error: $message")
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/firrtl/util/BackendCompilationUtilities.scala
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ object BackendCompilationUtilities extends LazyLogging {
s"""-Wno-undefined-bool-conversion -O1 -DTOP_TYPE=V$dutFile -DVL_USER_FINISH -include V$dutFile.h""",
"-Mdir", dir.getAbsolutePath,
"--exe", cppHarness.getAbsolutePath)
logger.info(s"${command.mkString(" ")}") // scalastyle:ignore regex
logger.info(s"${command.mkString(" ")}")
command
}

Expand All @@ -175,7 +175,7 @@ object BackendCompilationUtilities extends LazyLogging {
val e = Process(s"./V$prefix", dir) !
ProcessLogger(line => {
triggered = triggered || (assertionMessageSupplied && line.contains(assertionMsg))
logger.info(line) // scalastyle:ignore regex
logger.info(line)
},
logger.warn(_))
// Fail if a line contained an assertion or if we get a non-zero exit code
Expand Down
1 change: 0 additions & 1 deletion src/main/scala/logger/Logger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ object Logger {
* @param className class name of statement
* @param message a function returning a string with the message
*/
//scalastyle:off regex
private def showMessage(level: LogLevel.Value, className: String, message: => String): Unit = {
def logIt(): Unit = {
if(state.logClassNames) {
Expand Down
1 change: 0 additions & 1 deletion src/test/scala/firrtlTests/graph/DiGraphTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package firrtlTests.graph
import firrtl.graph._
import firrtl.testutils._

//scalastyle:off magic.number
class DiGraphTests extends FirrtlFlatSpec {

val acyclicGraph = DiGraph(Map(
Expand Down

0 comments on commit 63bfb32

Please sign in to comment.