mwittrock / cpilint

Automating your SAP Cloud Integration governance since 2019.
MIT License
57 stars 20 forks source link

Add parseable output #5

Closed codebude closed 5 years ago

codebude commented 5 years ago

It would be nice if you could implement another parameter like "structuredOutput" which either would result in a console output which is easier to parse programmatically like shown in (1) or which could be used in combination with a file path and then writes the result to a structure file like (2).

Thus we could use the tool automatically so that for example a programmer could trigger it via a "check your IFlow" website and only could release the transport if his development meets all criteria.

Example (1):

Results
--------------
Rule\tPassed
1\tX
2\t0
3\tX
4\tX

Example (2):

<?xml version="1.0"?>
<cpilint>
    <check-results>
        <result>
            <rule>iflow-description-required</rule>
            <passed>X</passed>
        </result>
        <result>
            <rule>disallowed-scripting-languages</rule>
            <params>
                <disallow>javascript</disallow>
            </params>
            <passed>0</passed>
        </result>
    </check-results>
</cpilint>
mwittrock commented 5 years ago

How issues are handled will definitely change a lot. What I have in place now is the barest of bare minimums; echoing the issue text to the console. Other issue handlers will be added over time, and it absolutely makes sense to add one that creates structured output, either to standard output or a file. Other ideas are posting to a Slack channel, creating an issue in an issue tracking system and sending an email or text.

(I'm not looking for pull requests on this at the moment.)

codebude commented 5 years ago

Hi @mwittrock - thanks for the quick feedback. This sounds promising. If there will be an issue handler/interface in the future, I would love to bring in some plugins/handlers/target systems.

mwittrock commented 5 years ago

There is already a separate interface for issue handling (dk.mwittrock.cpilint.consumers.IssueConsumer), with just the one implementing class at the moment. It probably needs a couple of lifecycle methods (startup(), shutdown()) for more complicated handlers.