Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file handling #62

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Configuration file handling #62

wants to merge 12 commits into from

Conversation

hanneskod
Copy link
Contributor

Prepares for a configuration file by adding the ability of reading configs from multiple sources. Configuration handling is moved to the Conf namespace.

Merging will close #13.

@enygma
Copy link
Member

enygma commented Jan 28, 2015

I'd like to also include a .dist file showing an example of the config file structure too (re: #13)

@hanneskod
Copy link
Contributor Author

This adds support for json config files, and brings in justinrainbow/json-schema to validate config file structure.

It includes a .psecio-parse.json with the settings used to run the travis builds. Is this good enough for you @enygma? Or do you think I should add support for .psecio-parse.json.dist as well?

The supported file format at this point is

{
    "paths": ["list-of-paths"],
    "ignore-paths": ["list-of-paths"],
    "extensions": ["list-of-extensions"],
    "whitelist-rules": ["list-of-rules"],
    "blacklist-rules": ["list-of-rules"],
    "disable-annotations": true|false,
    "format": "dots|progress|lines|debug|xml"
}

Instead of using verbose and debug settings I will add support for more format identifiers (lines and debug). I think that more clearly communicates what these settings actually do..

Documentation is also missing at this point...

@hanneskod
Copy link
Contributor Author

This is now ready for review..

@enygma
Copy link
Member

enygma commented Jan 31, 2015

So the idea of a .dist file is to provide an example of the configuration without having a hard-coded config in the release. This way they can just copy over the .dist and use it as the config or they can make their own without having to worry about git marking it as an updated file. And since the lists in there are subjective to whatever the user's project is, it won't work with a default value like "list-of-paths" as you have there.

You can use one of the pre-build commands in Travis to copy it over to the right place too.

@hanneskod
Copy link
Contributor Author

Ah ok, good point.

If I understand correctly we don't want to parse the .dist automatically, but leave it there as an example?

@redbeardcreator
Copy link
Contributor

Yes, a .dist file isn't parsed. And then there is no actual config file that ships, because we shouldn't overwrite an existing config file.

@hanneskod
Copy link
Contributor Author

Now there is a .dist file. I guess the fact that phpunit actually parses phpunit.xml.dist made me uncertain what the requested behavior was here..

As you can see a travis build failed. This was an hhvm issue. Investigations show that PhpParser is not stable for hhvm.

https://travis-ci.org/nikic/PHP-Parser

To reflect this fact I changed our travis config so that hhvm failure is allow.

With these changes this is again ready for review.

@redbeardcreator
Copy link
Contributor

Out of curiosity, why is the default file a dot file? I think I'd prefer to see it as an always-visible file.

@hanneskod
Copy link
Contributor Author

Oh, just my preference to keep "meta"-files dotted. But you are probably right. I'll change it later today..

@hanneskod
Copy link
Contributor Author

Done..

@redbeardcreator
Copy link
Contributor

I haven't tested everything out, but the code looks good. Presuming it all works, 👍

@hanneskod
Copy link
Contributor Author

I'll have a look at this to make it up to date some time in the future... If anyone else wants to have a go please do 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration file handling
3 participants