HairyFotr / linter

Static Analysis Compiler Plugin for Scala
Apache License 2.0
268 stars 34 forks source link

New checks: UseInitNotReverseTailReverse, UseLastNotReverseHead #33

Closed vdichev closed 8 years ago

vdichev commented 8 years ago

Two new checks:

HairyFotr commented 8 years ago

Thanks for contributing! :+1:

I ran grep over some code and found a list.reverse.headOption, so I've added that to UseLastNotReverseHead, and I've limited the checks to Scala collections and arrays.

vdichev commented 8 years ago

Good point, operations with reverse might make more sense in something like a banker's queue, e.g. https://github.com/djspiewak/scala-collections/blob/master/src/main/scala/com/codecommit/collection/BankersQueue.scala