I’m currently thinking of introducing linting for NodeTypes.yaml, Settings.yaml and all Fusion in our projects.
Regarding syntax checking NodeTypes and Settings there would be the possibility to use ./flow configuration:validate but it fails because the schemas are not up-to-date. E.g. if you use ContentRepository.Search the property search that is added to the NodeTypes properties violates the schema.
For settings that is also the case: e.g. Neos.Flow.object.excludeClasses which is a allowed property is also considered invalid by the schema.
How could we make this consistent?
The second topic is how to check fusion? Ideas appreciated.
I was hoping I could just call the Fusion parser from CLI and get parsing exceptions if the fusion files are malformed. A quick implementation https://gist.github.com/hhoechtl/7cf2d99299355483668cf602bdbe9e79 turned out that it doesn’t.
I tried to call ./flow fusionlint:check --site-resources-package-key=Onedrop.Site but it only threw exceptions on some obvious mistakes.
It’s a good start tough, but the following syntax errors can’t be detected that way e.g. missing closing curly braces:
Just built an object-tree which nested javascript under content but did not throw any exception that there’s a missing curly brace.
It also didn’t complain about non-existing objects, because that’s only evaluated by the runtime and I also realized that the object-tree is not containing all objects from all packages. I couldn’t yet figure out how to load all fusion files in the right order like the rendering would.
To be able to detect if the rendering would work I would also need to instantiate the Runtime but I would need nodes, so either a working database or a mock (both are not very handy).
Maybe somebody who is more familiar with the Fusion runtime itself could share some insights here if it’s possible somehow to check the rendering in CLI without database (simple CI environment).