lightbend-labs / cloc-plugin Goto Github PK
View Code? Open in Web Editor NEWcount lines of code. used in Scala 2 community build; also a near-minimal example Scala 2 compiler plugin
License: Apache License 2.0
count lines of code. used in Scala 2 community build; also a near-minimal example Scala 2 compiler plugin
License: Apache License 2.0
at Scala Bay last night I asserted that I'd tried it and it didn't work, but afterwards I started wondering if that was a false memory. did I really try it?
I should try it (again?) and see what happens, and perhaps change or comment the code depending on result
there is advice on this in the “Compiler Plugins 101” slides, but it might as well be in this repo directly, too
@hrhino has suggested using this to test:
scalacOptions in Test ++= Seq(
s"-Xplugin:${(packageBin in Compile).value}",
s"-Jdummy=${System.currentTimeMillis()}",
)
the -Jdummy
thing is an attempt to fool sbt into rebuilding when necessary; it's copied (perhaps cargo-culted) from scala-continuations; I should see whether it is necessary on modern sbt, whether it actually works, and whether there's a better, less kludgey way
when I gave my “Compiler Plugins 101” talk at Scala Bay somebody asked whether the files are always java.io.File
s
the plugin code currently assumes there's always an underlying java.io.File
, and that's not a completely safe assumption, e.g. when you're using the REPL the source "file" is just virtual
it hasn't come up in the community build context, but since this plugin is also for teaching, it would be better to handle this properly
Anthony Cerruti suggesting checking out tokei
which is faster than cloc
, and also more accurate than cloc
for at least some languages, not sure about Scala in particular
someone at Scala Bay last night asked about this. I call super.run()
but @retronym's boxer plugin doesn't. does it actually do anything, is it necessary? or did I just cargo-cult it from somewhere?
well this isn't strictly related to this plugin in particular, but using this issue tracker anyway...
while delivering “Compiler Plugins 101” I got confused about whether -Xplugin-list
works or not. I have a slide that seems to show that it does, but then didn't I also find something that didn't work? confused
some of the things I say live during the “Compiler Plugins 101” talk might as well become comments in the code
for example, advice about runsBefore
and runsAfter
I didn't initially bother, since the initial purpose of this plugin was for use in the community build, where all dependencies are rewired by dbuild anyway
but now that I'm using this repo in my “Compiler Plugins 101” talk, I should give people a skeleton that handles this the right way
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.