A script that makes my pkg development workflow smooth

Hey all,

No question here, I just want to share the central tool of my development workflow I have used for years now.

Three years ago, I was working on an Angular project and I was amazed by the tooling. Especially, the ng serve command. Basically, you run ng serve while writing your code. It auto-refreshes the web app in the browser each time you save a file. It makes development incredibly smooth!

So back on a Julia package project, I wanted a similar tool. I wanted to see immediately whether my unit tests passed as soon as I saved a file with new changes . Together with a colleague, we built a first version of this tool using Revise. I later improved the tool to refresh the tests whenever code changes occur in either the package or the tests.

I created an “EmptyPackage” repository to share the scripts and the architecture :

GitHub - nablarise/EmptyPackage.jl

To run the tool :

  • run the runtests.sh script.
  • the script calls julia runtests.jl auto to execute the run_tests_on_change defined in test/revise.jl

To use this tool in your package :

It’s far from perfect. It suffers from the “limitations” of Revise/Julia. You’ll need to restart the tool when changing a type for instance. I’m also pretty unsure about how I handle the exceptions :slight_smile: However, all the errors are clearly displayed in the console and the tool makes me more productive!!!

Feedback and suggestions are welcome!

Very cool! Also, with 1.12 and upcoming updates to Revise, updating types will no longer require restarts!