0

Currently i'm creating ci/cd for my gitlab, using gitlab runner and code_quality. https://docs.gitlab.com/ee/ci/testing/code_quality.html

so inside the gitlab runner, we running in docker:stable and code_quality using codeclimate/codeclimate inside

.js, .css, and .pylint is running fine. i get all the report but I facing problem with xml, because xml is not there when I check codeclimate engines:list i tried to install xmllint inside the docker codeclimate/codeclimate but it's not working

so i install xmllint inside my docker docker:stable and do xmlint in docker

docker run --rm -v $(pwd):/project docker:stable sh -c 'cd /project && xmllint --noout --format --recover /project/*.xml | tee xml-code-quality-report.json'

I can generate report like this

/project/test_xml_script.xml:6: parser error : Opening and ending tag mismatch: field line 5 and record
    </record>
             ^
/project/test_xml_script.xml:9: parser error : StartTag: invalid element name
        <field name="name"> < Images & Upload </field>
                             ^
/project/test_xml_script.xml:9: parser error : xmlParseEntityRef: no name
        <field name="name"> < Images & Upload </field>
                                      ^
/project/test_xml_script.xml:11: parser error : Opening and ending tag mismatch: field line 5 and odoo
</odoo>
       ^
/project/test_xml_script.xml:12: parser error : Premature end of data in tag record line 4

so the question is how to put this xml-code-quality-report.json to gl-code-quality-report.json with the correct format so i can see it in code quality report in MR

{"engine_name":"eslint","fingerprint":"987aeddee812579384b4f3da62a458bb","type":"issue","categories":["Style"],"check_name":"array-bracket-newline","description":"Definition for rule 'array-bracket-newline' was not found","content":{"body":"For more information visit Source: http://eslint.org/docs/rules/\n"},"location":{"path":"test_js_script.js","positions":{"begin":{"line":2,"column":1},"end":{"line":2,"column":1}}},"remediation_points":50000,"severity":"minor"}
Vii
  • 1

0 Answers0