Skip to content

Improve htmldocck.py error messages #30303

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

Merged
merged 1 commit into from
Dec 10, 2015
Merged

Improve htmldocck.py error messages #30303

merged 1 commit into from
Dec 10, 2015

Conversation

mitaa
Copy link
Contributor

@mitaa mitaa commented Dec 10, 2015

This changes the error output and behaviour to:

  • not emit python backtraces
  • run all checks
  • include a context line per error
  • move the offending line-number to the start of the line

fixes #21455

@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@mitaa
Copy link
Contributor Author

mitaa commented Dec 10, 2015

cc @Diggsey, @lifthrasiir

Sample output:

---- [rustdoc] rustdoc/test.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/home/mitaa/dev/rust/src/etc/htmldocck.py" "x86_64-unknown-linux-gnu/test/rustdoc/test.stage1-x86_64-unknown-linux-gnu" "/home/mitaa/dev/rust/src/test/rustdoc/test.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
1: Tried to use the previous path in the first command
    // @has -
4: @has check failed
    File does not exist 'test/doesnt_exist.html'
    // @has test/doesnt_exist.html
5: @has check failed
    `XPATH PATTERN` did not match
    // @has test/index.html '//*[@class="rust trait"]' 'trait Deref2 {'
6: Unimplemented @valid-links
    // @valid-links

Encountered 4 errors

------------------------------------------

Previous output

---- [rustdoc] rustdoc/test.rs stdout ----

error: htmldocck failed!
status: exit code: 1
command: "/usr/bin/python2.7" "/home/mitaa/dev/rust/src/etc/htmldocck.py" "x86_64-unknown-linux-gnu/test/rustdoc/test.stage1-x86_64-unknown-linux-gnu" "/home/mitaa/dev/rust/src/test/rustdoc/test.rs"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
Traceback (most recent call last):
  File "/home/mitaa/dev/rust/src/etc/htmldocck.py", line 397, in <module>
    check(sys.argv[1], get_commands(sys.argv[2]))
  File "/home/mitaa/dev/rust/src/etc/htmldocck.py", line 390, in check
    c.cmd, c.lineno))
RuntimeError: @has check failed at line 1

------------------------------------------

@brson
Copy link
Contributor

brson commented Dec 10, 2015

@bors r+

Thanks. Nice improvements.

@bors
Copy link
Collaborator

bors commented Dec 10, 2015

📌 Commit cf81e1a has been approved by brson

@bors
Copy link
Collaborator

bors commented Dec 10, 2015

⌛ Testing commit cf81e1a with merge 611e8b4...

bors added a commit that referenced this pull request Dec 10, 2015
This changes the error output and behaviour to:
* not emit python backtraces
* run all checks
* include a context line per error
* move the offending line-number to the start of the line

fixes #21455
@bors bors merged commit cf81e1a into rust-lang:master Dec 10, 2015
@mitaa mitaa deleted the htmldocck branch December 10, 2015 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better error messages for htmldocck.py
4 participants