Linting for configurations, fusion

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.

Fixing the Schema and allowing ‘search’ is on my list for the hamburg sprint.

In our current projects we are validating that all files match the .editorconfig with https://github.com/editorconfig-checker/editorconfig-checker.php

Php is checked with phpCodeSniffer

Additionally we have a flow package that validates that node types and fusion prototypes are defined in files with matching pathes and/or names.

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:

page = Onedrop.Site:Page {
    body {
        content {
            // The default content section
            main = Neos.Neos:PrimaryContent {
                nodePath = 'main'
            }
            footer = Neos.Neos:ContentCollection {
                nodePath = ${q(site).find('footer').property('_path')}
                collection = ${q(site).children('footer').children()}
            }
        // }  commented out on intention

        javascripts.site = Neos.Fusion:Template {
            templatePath = 'resource://Onedrop.Site/Private/Templates/Page/Default.html'
            sectionName = 'BodyScripts'
        }
    }
}

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).