tidy的错误消息应在某处包含文件名

时间:2018-12-17 12:43:53

标签: html static filenames analysis tidy

我需要为HTML 5代码运行静态代码分析工具。 我发现整理会有所帮助。 下载链接:http://binaries.html-tidy.org/

对于ubuntu 16.04如何下载:-
sudo wget https://github.com/htacg/tidy-html5/releases/download/5.2.0/tidy-5.2.0-32bit.deb

如何安装:-sudo dpkg -i --force-overwrite tidy-5.2.0-32bit.deb
--force overwrite(因为我在安装时遇到了覆盖错误)

将配置文件放在家庭位置:- vi config.txt

//SAMPLE CONFIG FILE
indent: auto
indent-spaces: 2
wrap: 72
markup: yes
output-xml: no
input-xml: no
show-warnings: no
numeric-entities: yes
quote-marks: yes
quote-nbsp: yes
quote-ampersand: no
break-before-br: no
uppercase-tags: no
uppercase-attributes: no
char-encoding: latin1
new-inline-tags: cfif, cfelse, math, mroot,
  mrow, mi, mn, mo, msqrt, mfrac, msubsup, munderover,
  munder, mover, mmultiscripts, msup, msub, mtext,
  mprescripts, mtable, mtr, mtd, mth
new-blocklevel-tags: cfoutput, cfquery
new-empty-tags: cfelse

现在,转到您的代码所在的仓库,并编写脚本:-vi script.sh

#!/bin/bash
rm tidy1.log
for FNAME in $(find . -name "*.html") ; do
     tidy -o ./output.txt -q -f log12345 -config ~/config.txt $FNAME
if [[ -s ./log12345 ]
then
        echo " ---$FNAME" >> tidy.log
        cat ./log12345 >> tidy.log
        echo " " >> tidy.log
        rm log12345
fi
done
rm log12345     #REMOVE AFTER THE LAST RUN

授予对script.sh的完全许可: chmod 777 script.sh

运行script.sh检查您的代码:-./script.sh

0 个答案:

没有答案