Skip to content

feat(ci): add a linter/formater for xml

Didier WECKMANN requested to merge 71-add-a-linter-formater-for-xml into dev

Description

Uses Prettier + XML plugin. Take a look at https://github.com/prettier/plugin-xml for installation and usage

Results

XML will now be somewhat checked and formatted.

How to test it?

For Prettier:

  • Checkout second commit
  • Install prettier and prettier XML plugin:
    • On Windows:
      • install nodejs >14 + npm (normally done for cspell)
      • npm install --global prettier @prettier/plugin-xml
    • On Linux
      • install nodejs >14 + npm. To update node easily:
        sudo npm install -g n
        sudo n stable
        hash -r
      - `sudo npm install --global prettier @prettier/plugin-xml`
      

For both

  • Find a badly formatted xml file (there are a lot..)
  • Stage the file and launch Sheldon:
    • An error is reported if the file is not indented correctly
  • Relaunch Sheldon with -f
    • The file is reformatted

Related issue(s)

Closes #71 (closed)

Edited by Didier WECKMANN

Merge request reports