Re: Linter / Syntax Checker for template files for Engine 2.3?

Nathan Bubna <[email protected]> Fri, 16 Aug 2024 08:37:50 -0700
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <CAFyaDjH2UiO3eE6dk0i6ZimA3ptvT-CqTqunakDmyXHuyux+4A@mail.gmail.com>
--00000000000098e712061fcebe0d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Your research is fairly complete, so far as i know. I would not scorn,
however, a linter/validator that is old. I don't think we have changed
anything in terms of valid syntax. There were perhaps some subtle changes
and those maybe behind flags even since 2.1 (5+ years ago) and maybe a few
more (additive) changes between 2.0 and 2.1 (7 yrs ago). And even 2.0
itself did not deprecate syntax that i recall, largely it added options and
changed some behavior/API features. I suspect that any 1.x validator will
still be of value in the 2.x era.

Oh, and TemplateTool had not validation/syntax features.

On Wed, Aug 14, 2024 at 5:31=E2=80=AFPM Philip Schlesinger
<[email protected]> wrote:

> Hi all,
>
>
>
> Where can I find a linter / syntax checker for template files written for
> Engine 2.3?
>
>
>
> Jama Software=E2=80=99s implementation of Velocity Engine 2.3 starts with=
 an
> export of a Word .mht file.  Jama then adds in data sources and macros.
>
>
>
> The _*boilerplate*_ Velocity template file for a Word document is =E2=80=
=93 I kid
> you not =E2=80=93 4,408 lines of code.
>
>
>
> The amount of code that needs to be touched to customize the template fil=
e
> for one=E2=80=99s own usage: less than 200 lines of code =E2=80=93 about =
4.5%.
>
>
>
> At this time, they do not permit the usage of parent-template.vm and
> child-template.vm =E2=80=93 then using the #parse directive.
>
>
>
> So to reduce the chance of a fat-finger, I=E2=80=99ve split the 4,408 lin=
es of
> code boilerplate file into multiple files =E2=80=93 separating out sectio=
ns where
> one would customize (title page, header, main body, etc.) from the sectio=
ns
> which one should normally not touch (for instance: the CSS that came from
> the Word .mht file).
>
>
>
> With a `cat *.vm` command, voila! We have a unified file again.
>
>
>
> Just to be safe, I=E2=80=99d like to run a linter / syntax checker on it.=
  So far
> the only checker I=E2=80=99ve found that is built to support Engine 2.3 i=
s `pmd`:
> https://docs.pmd-code.org/latest/pmd_rules_velocity.html
>
>
>
> Even then, I=E2=80=99m not sure if it=E2=80=99s truly doing a thorough li=
nt / syntax check.
>
>
>
> The npm velocity-lint hasn=E2=80=99t been updated in 8 years:
> https://github.com/leemotive/velocity-lint
>
>
>
> Velocity-validator last got an update 6 years ago:
> https://github.com/todvora/velocity-validator
>
>
>
> This whole StackOverflow is from 14 years ago:
> https://stackoverflow.com/questions/1910857/apache-velocity-is-there-a-st=
andard-way-of-verifying-the-correctness-of-a-templ
>
>
>
> I=E2=80=99ve seen posts about a =E2=80=9CTemplate Tool=E2=80=9D =E2=80=93=
 but I can=E2=80=99t find it =E2=80=93 and I=E2=80=99m
> guessing it hasn=E2=80=99t been supported in years.
>
>
>
> Hence my email to the community.
>
>
>
> Is there a velocity linter / syntax checker out there that evaluates
> Engine 2.3 =E2=80=93 or is there example code that I can copy/paste to bu=
ild my own?
>
>
>
> Thank you for your assistance!
>
>
>
> --
>
>
>
> *Philip Schlesinger*
> *Solution Architect =E2=80=93 Core Systems*
>
>
>
> [image: Blue text on a black background Description automatically
> generated] <http://www.cryoport.com/>
>
> *=C2=AD=C2=AD*
>
> *Office:  *+1 (949) 681-2794
>
> *24/7/365 Support:  *+1 (949) 470-2305
>
>
>
> *Americas **=E2=80=A2** EMEA **=E2=80=A2* *APAC*
>
> *cryoport.com* <http://cryoport.com/>
>
>
>
> [image: A blue circle with white and black logo Description automatically
> generated] <https://www.linkedin.com/company/856887>[image: A blue circle
> with white x in it Description automatically generated]
> <https://twitter.com/cryoport> [image: A blue circle with a white play
> button Description automatically generated]
> <https://www.youtube.com/user/CryoportVideo>
>
> =C2=AD=C2=AD
>
> The information contained in this e-mail message is privileged and
> confidential information and is intended only for the use of the individu=
al
> and/or entity identified in the address of this message. If the reader of
> this message is not the intended recipient, or an employee or agent
> responsible to deliver it to the intended recipient, you are hereby
> notified that any disclosure, copying, distribution, or reliance upon the
> contents of this email is strictly prohibited. If you have received this
> communication in error, please notify us by return e-mail. In this
> circumstance, we request that you delete the original message from your
> system.
>
>
>

--00000000000098e712061fcebe0d--