Closed tralston closed 4 years ago
Quokka does not currently have any mechanism to check for comments prior to committing your code, nor is this something that is currently on our roadmap.
The eslint plugin idea sounds promising. If you wanted, you could create something as simple as a program that runs a regex to look for //?
or /?/ for multi-line comments and if it finds either of those, return an exit code of 1. If you're not familiar with githooks, this article may assist you.
If you create/configure something bespoke, could you please share with us so we can let others know?
In case you are not aware, in December 2019, we added a Quokka PRO feature so that Quokka now displays values on selection. This works whenever you select a value on a single line. In your case, if you selected b
, Quokka would output something
as an inline value, and will also display the value in value explorer if you wish to explore it. If you want to always display a value (or values across multiple lines) for every execution, then you may find you still want to use the live comment format.
Thanks @smcenlly! I'll let you know if I ever got something working.
Issue description or question
I'm new to Quokka, and I'm really liking it. I am seeing, however, that if I'm using live comments in my code a lot, that I'll eventually forge to clean them up before committing to our codebase.
Is there any built in mechanism to warn if there are any quokka-related comments in the code? If not, any suggestions of how to implement this into a git pre-commit hook?
The only way I can think of is to write a custom eslint plugin that looks for comments containing the special characters looked for by the quokka engine.
Sample code
Above code should fail and abort a commit letting me know that there are leftover live comments hanging around.
Version: 1.48.0-insider Commit: 15e798e081984a17eae00de91adf4479190d5ed2 Date: 2020-07-28T10:40:03.139Z (18 hrs ago) Electron: 9.1.0 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.5.0