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

introduce HTML tidy checks for HTML descriptions #1456

Merged
merged 3 commits into from
Apr 19, 2018

Conversation

ivangalkin
Copy link
Contributor

@ivangalkin ivangalkin commented Apr 11, 2018

  • create check_rules.sh and extend cppcheck_createrules.py
for each rule.xml in cxx-sensors/main/resources:
    check rule.xml with xmllint
    parse rule.xml
        for each rule in rule.xml:
            dump rule.attr("description") to tmp.ruledump
            check tmp.ruledump with tiny-html5
  • fix issues w.r.t. HTML formatting and escaping
  • many important HTML issues were fixed, but also many [escaping] issues which SonarQube seems to tolerate

@guwirth is there a chance to activate check_rules.sh in continuous integration? FYI it uses [linux] tools (xmllint and tidy-html5), which probably have to installed additionally.


This change is Reviewable

* create check_rules.sh and extend cppcheck_createrules.py
-> for each rule.xml in cxx-sensors/main/resources:
      check rule.xml with xmllint
      parse rule.xml
      for each rule in rule.xml:
         dump rule.attr("description") to tmp.ruledump
         check tmp.ruledump with tiny-html5

* fix isses w.r.t. HTML formatting and escaping
@guwirth guwirth requested review from Bertk and guwirth April 13, 2018 05:49
@guwirth guwirth added this to the 1.0 milestone Apr 13, 2018
@guwirth
Copy link
Collaborator

guwirth commented Apr 13, 2018

is there a chance to activate check_rules.sh in continuous integration? FYI it uses [linux] tools (xmllint and tidy-html5), which probably have to installed additionally.

@ivangalkin we are using Travis for testing with Linux. The entry point is the file https://github.com/SonarOpenCommunity/sonar-cxx/blob/master/.travis.yml. You can try to add your script in the script: section. In https://travis-ci.org/SonarOpenCommunity/sonar-cxx you see the LOG files.

Not sure if xmllint and tidy-html5 is pre-installed (think not). In this case you have to install it in one of the before_script, install or before_script steps.



def call_tidy(file_path):
command = ["/home/igalkin/workspace_myGITHUB/tidy-html5/build/cmake/tidy", file_path]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script is using a local path from your PC

@ivangalkin
Copy link
Contributor Author

@guwirth thank you for the comments and the information about travis
since the change is already pretty large I would limit its scope to the XML adjustment
I will address the CI integration in the future pull request

@guwirth
Copy link
Collaborator

guwirth commented Apr 14, 2018

@Bertk ready to merge?

@guwirth
Copy link
Collaborator

guwirth commented Apr 18, 2018

@Bertk any comments. Will merge it this evening...

@guwirth guwirth merged commit 14089b8 into SonarOpenCommunity:master Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants