5 ms·
I'm not very current on the Scala tooling - is there a reasonable lint tool which enforces these types of suggestions?
by danielbarla 12y ago
I'm not very current on the Scala tooling - is there a reasonable lint tool which enforces these types of suggestions?
- tempodox 12y agoI think it's commonly called your brain.
- virtualwhys 12y agoBrian McKenna's Wart Remover[1] is an excellent tool for capturing silent (but deadly) errors at compile time. Can also turn on various scalac -X flags to, for example, turn warnings into compile time errors. Invoke scala REPL with -X to see available flags. [1] https://github.com/typelevel/wartremover https://github.com/typelevel/wartremover
- danielbarla 12y agoThanks, very useful. It's nice to see that both Wart Remover and OP's post had reasonable explanations and examples to justify each rule. This makes the rule all that much better as a learning experience (contrast with, e.g. "I have never seen a piece of code that was not improved by refactoring it to remove the continue statement" from JavaScript: The Good Parts, which leaves me baffled and no wiser).
- adriaanm 12y agoWe've been working on https://github.com/scala/scala-abide https://github.com/scala/scala-abide. Our aim is to provide a nice platform for others to develop and distribute style checking rules. We (the core scalac devs) intend to focus on keeping the abide platform up to date with the compiler, letting the community evolve the set of rules. Due to resource constraints, we haven't made a big push in advertising it yet, but we're happy to work with you if you'd like to start implementing rules. Have a look at recent PRs for some examples.
- danielbarla 12y agoThanks for the info, and kudos on the good work in general! Abide looks quite nice, although I'm a very occasional user of Scala so far, so I'm not sure I'd be very good at coming up with and implementing rules. I'll definitely spread the word to some friends who use Scala more frequently, and may be able to contribute.
- adriaanm 12y agoThanks! Please don't hesitate to ask (ideally on scala-internals) if you'd like some pointers to get started with abide.
- ionforce 12y agoIntelliJ's Scala plug-in has some support for things like these.