Thanks for trying it out! I’ll see if I can get something simple working with the .syntax files where I just support a couple of the additional procedures brought by the modulefile interpreter.
> On Mar 22, 2022, at 10:43 PM, Xavier Delaruelle <xav...@gm...> wrote:
>
> The "source syntaxbuild.tcl" + "buildFile mysyntaxdb.tcl" approach described in the Nagelfar documentation does not seem to work when called from a modulefile evaluation context. I have seen that there are also ".syntax" files : maybe that is a simpler approach to describe in such files the additionnal procedures and variables brought by the modulefile interpreter. But I do not know if global variables are supported in these .syntax file.
>
> Regards,
> Xavier
>
> Le lun. 21 mars 2022 à 21:35, Erik Parawell <eri...@si... <mailto:eri...@si...>> a écrit :
> Thanks Xavier for the detailed answer!
>
> I’ll check out that formatting script and give it a test.
>
> In regards to Nagelfar, I’m looking into the syntaxbuild.tcl and it looks like it is partially hardcoded and then tries to extract things from the interpreter like subcommands. http://nagelfar.sourceforge.net/syntaxdatabases.html#creating-syntax-databases <http://nagelfar.sourceforge.net/syntaxdatabases.html#creating-syntax-databases>
>
> Do you know how to can run tcl scripts from the modulefile interpreter?
>
>> On Mar 19, 2022, at 5:33 AM, Xavier Delaruelle <xav...@gm... <mailto:xav...@gm...>> wrote:
>>
>>
>> Le ven. 18 mars 2022 à 22:01, Erik Parawell <eri...@si... <mailto:eri...@si...>> a écrit :
>> Hi,
>>
>> I’m managing a lot of module files and I was wondering if there is a linter for modules files or maybe some formatter (espeically for indentation). I have seen that nagelfar132 is a good linter for TCL code and that you can create a new syntax database using a provided scrip, but I can’t figure out if I can even run that script with the module interpreter.
>>
>> Suggestions are welcome!
>>
>> Regards,
>> Erik Parawell
>>
>> Hi Erik,
>>
>> As far as I know there is no linter existing for modulefiles. Best thing available at the moment is to use "module test" against the modulefiles to see if there are syntax errors.
>>
>> Using Nagelfar for linting seems quite interesting. Need to figure out how a new syntax db could be generated with all Tcl commands and variables added by the modulefile interpreter.
>>
>> Regarding code formatter, it seems there are not a lot of solution available out there. I have found (but not tested) this script proposed by the Tcl community:
>> https://wiki.tcl-lang.org/page/Reformatting+Tcl+code+indentation <https://wiki.tcl-lang.org/page/Reformatting+Tcl+code+indentation>
>>
>> Regards,
>> Xavier
>> _______________________________________________
>> Modules-interest mailing list
>> Mod...@li... <mailto:Mod...@li...>
>> https://lists.sourceforge.net/lists/listinfo/modules-interest <https://lists.sourceforge.net/lists/listinfo/modules-interest>
>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li... <mailto:Mod...@li...>
> https://lists.sourceforge.net/lists/listinfo/modules-interest <https://lists.sourceforge.net/lists/listinfo/modules-interest>
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
|