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

Including split configuration files from subdirectories #6058

Closed
turnabout opened this issue Jul 7, 2021 · 1 comment · Fixed by #6059
Closed

Including split configuration files from subdirectories #6058

turnabout opened this issue Jul 7, 2021 · 1 comment · Fixed by #6059

Comments

@turnabout
Copy link

turnabout commented Jul 7, 2021

In my psalm.xml config file, I'd like to include bits of configuration from split xml files that are located in subdirectories relative to my psalm.xml.

I've followed the instructions on https://psalm.dev/docs/running_psalm/configuration/ which shows how to accomplish that using XInclude tags. Here is a barebones example of what I'm trying to do with my configuration:

psalm.xml

<?xml version="1.0" encoding="UTF-8"?>
<psalm
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
    xmlns:xi="http://www.w3.org/2001/XInclude"
>
    <xi:include href="vendor/anotherProject/configurations/psalm-projectFiles.xml" />
</psalm>

vendor/anotherProject/configurations/psalm-projectFiles.xml

<?xml version="1.0" encoding="UTF-8"?>
<projectFiles xmlns="https://getpsalm.org/schema/config">
    <directory name="src"/>
    <ignoreFiles>
        <directory name="vendor"/>
    </ignoreFiles>
</projectFiles>

Running psalm with the above configuration results in this error:

Problem parsing /applications/src/myApp/psalm.xml:  Error on line 2:
    Element '{https://getpsalm.org/schema/config}projectFiles', attribute '{http://www.w3.org/XML/1998/namespace}base': 
    The attribute '{http://www.w3.org/XML/1998/namespace}base' is not allowed.
@orklah
Copy link
Collaborator

orklah commented Jul 7, 2021

Weird, it seems to complain about a base attribute on projectFiles element but I see no such thing in your snippets.

Are you sure you showed us the correct ones?

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 a pull request may close this issue.

2 participants