PawelStroinski / dockerfile-stevia

Write your Dockerfiles in Clojure (or Babashka).
19 stars 1 forks source link

Optional ns-qualified keywords #6

Open vemv opened 9 months ago

vemv commented 9 months ago

Hi @PawelStroinski !

Very nice lib - I'm looking forward to use it the next time the need pops up.

It occurred to me that if each keyword had a ns-qualified equivalent, one could:

In practice, this an agnostic pattern that works:

(spec/def ::from string?
  #_"The FROM instruction initializes a new build stage and sets the Base Image for subsequent instructions.
As such, a valid Dockerfile must start with a FROM instruction.
The image can be any valid image – it is especially easy to start by pulling an image from the Public Repositories.")

...the #_ is a minimalistic way to add a docstring even when it's not supported currently at Spec level.

A couple of tools that can work with that:

wdyt?

Thanks - V

PawelStroinski commented 9 months ago

Hi @vemv,

Thank you so much for your kind feedback and the idea. In addition to attaching the docstrings and discoverability of the available options, I like it because:

My thoughts:

Time-permitting, I will think about implementing this, and of course more feedback or PR(s) would be welcomed. Thank you again for the comment and have a good weekend!

Paweł