Open jurgenvinju opened 1 year ago
The current checker has errorsAsWarnings
set to true
, which is why the build does not fail on these reports. Later when we've all fixed them, let's set it to false to avoid those things creeping back in slowly.
Right. I'll take a look, I knew about some of the warnings. For the errors, this is tricky, since these are references to values defined in lang::php::util::Config
(which may be moved to lang::php::config::Config
in the future, this is what we've done in Go AiR). However, these are install-specific, so we don't distribute this file. We instead distribute a template and make people add this file into their own project, either here or in a project that includes PHP AiR as a dependency. Is there a way to provide a version of this file to the build process, with the correct paths set? We don't have defaults for these.
proposal. we could use a JSON, XML, YAML, or MANIFEST file to configure php-analysis, in a similar way we use PathConfig
instances to configure the Rascal compiler. We could even use PathConfig itself, and extend it with a number of fields?
lang.manifest.IO
library binds the fields in a manifest file to the fields of an AST constructor. It also offers comma separated lists.lang.json.IO
, and the json, yaml and xml variants all bind external data easily by mapping to data constructors as well.And then we'd pass this configuration information down to all the analysis functions. We could have a default template file and users could use their own. Using the defaults of constructor keyword parameters, also sensible defaults can be programmed into the system.
That way we always have a Config module and the code would be ready for compilation.
I would be in favor of moving the config to a yaml file. The problem I ran into before was the following -- I need a way to load the file, but there doesn't seem to be a way for the project to figure out where it is. So, to load the file, I need a path, but to get the path, I would need to put it into a config file. If there is a way around this, that would be great -- I brought it up a while back (when I was starting to update this project) but couldn't really think of a good way around it.
This is not immediately obvious: