GithubHelp home page GithubHelp logo

Comments (4)

sideshowbarker avatar sideshowbarker commented on May 20, 2024

Are you using the -g option? Trying the script myself I find that when I use -g option it does't work. I'm not sure why at this point. I didn't write the script and it's not really maintained, but I'll try to make some time to look into over the next couple days. In the mean time, maybe @hsivonen might be able to say.

Otherwise, the version of the script at https://github.com/validator/validator/blob/master/resources/examples/html5check.py appears to still be working as expected when I use it without specifying any other options. Are you using that version? Without any options specified?

The last couple of days the test script stopped working.

If you're not using the -g option, can you be more specific? Exactly in what way has the script stopped working? e.g., it doesn't run at all, or it runs but you get some error message? (If so, what error message.) Or it runs without errors but the output isn't what you expect?

Has the output from validator.nu changed in the last couple of days?

Yes, I made some changes to the backend recently that have some effect on the metadata of the error messages that get emitted; in particular, the messages now emit a range identifier for the location of the error in the document source, rather than a single position identifier. I wouldn't think that would affect the behavior of this script—because I'd assume the script is just passing on the messages as-is—but maybe it's trying to do some post-processing of the messages (I have no idea because I haven't looked in detail at the script source yet to see).

from validator.

153957 avatar 153957 commented on May 20, 2024

I specified the errors in more detail in this issue at html5-lint: mozilla/html5-lint#15
Yes, I am using the -g (and -eh) option.

Apperantly the response variable in the script is no longer automatically an interator over the lines.

Traceback (most recent call last):
  File "./html5check.py", line 232, in <module>
    for line in response:
TypeError: iteration over non-sequence

I was able to get the script working again with a small modification to that for-loop causing the error:

for line in response.read().split('\n'):
  if line:
      sys.stdout.write(quotedName)
      sys.stdout.write(line + '\n')

I use the -g option to get the output as separate lines, because I want to filter the output.
My usage of the script (on Travis to check my websites):

CHECK=$(for file in *.html; do python ../html5check.py -geh $file; done;)
if [[ ! -z $(echo "$CHECK" | grep -vE 'index_|iframe') ]]; then echo "$CHECK"; exit 1; fi;

The script itself does not seem to do any post processing to the actual content of the response.
The latest version of the script from html5-lint also works without the -g option.

from validator.

sideshowbarker avatar sideshowbarker commented on May 20, 2024

OK it sounds like you got the fix you need. So maybe you could open a PR against the https://github.com/mozilla/html5-lint/blob/master/html5check.py and after that I can backport it to the https://github.com/validator/validator/blob/master/resources/examples/html5check.py upstream version.

Or if you believe I've regressed the backend in some way that I should fix, lemme know.

from validator.

153957 avatar 153957 commented on May 20, 2024

Fixed in mozilla/html5-lint#16

from validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.