Fork me on GitHub

Anyone had much luck with editor integration for Guardrails?


what kind of integration?


my guess is that you want something like this: (which is not available yet)


Perhaps you mean "resolve as..."? It follows the normal form of functions, so resolving it as a defn works well (in IntelliJ, and I'm sure in most others).


I think copilot is what I'm thinking of, more or less. If we already have the Guardrails annotations, it seems to me they should be usable statically too, not just at runtime... at least technically possible. Maybe even the runtime results can have some editor integration. Like if a function is returning a non-conforming value during execution, the Guardrails log contains enough data to identify the exact place in the code and that data could be used to annotate the code in the editor with some warning indicator.


An editor cannot "run" them, nor can a linter (except in some trivial cases). Specs are turing complete. You have to actually evaluate the specs in the runtime where they are defined. This is made even more complicated for CLJC where the CLJS context could be diff than the CLJ need to try it in both runtimes to really give fully accurate results.