Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#4051 defect closed fixed (fixed)

lore lint output format appears to be broken

Reported by: khorn Owned by:
Priority: normal Milestone:
Component: lore Keywords:
Cc: Thijs Triemstra, khorn Branch: branches/lore-lint-4051
branch-diff, diff-cov, branch-cov, buildbot
Author: therve

Description

When running

lore -olint mydocument.xhtml

a traceback similar to the following is produced (using conch\index.xhtml as an example):

conch/index.xhtml:0:0: title and h1 text differch/index)
conch/index.xhtml:0:0: only list items allowed in lists
conch/index.xhtml:0:0: only list items allowed in lists
conch/index.xhtml:0:0: only list items allowed in lists
Traceback (most recent call last):
  File "C:\Python26\scripts\lore.py", line 21, in <module>
    run()
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\scripts
\lore.py", line 149, in run
    result = runGivenOptions(opt)
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\scripts
\lore.py", line 131, in runGivenOptions
    walker.generate()
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\process
.py", line 53, in generate
    self.df(fullpath, linkrel)
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\default
.py", line 54, in <lambda>
    return lambda file, linkrel: lint.doFile(file, checker)
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\lint.py
", line 218, in doFile
    checker.check(doc, file)
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\lint.py
", line 24, in check
    method(dom, filename)
  File "c:\documents and settings\hornk\desktop\twisted-dev\twisted\lore\lint.py
", line 103, in check_80_columns
    if node.getAttribute('class', '').endswith('listing'):
TypeError: getAttribute() takes exactly 2 arguments (3 given)

looks to be a bug in lore

also notice that the output of the tile and h1 text comparison is a bit goofy.

Attachments (2)

lore_lint_fix.patch (670 bytes) - added by khorn 13 years ago.
lore_lint_fix.2.patch (1.6 KB) - added by khorn 13 years ago.
patch with test added

Download all attachments as: .zip

Change History (15)

comment:1 Changed 13 years ago by khorn

Owner: spiv deleted

comment:2 Changed 13 years ago by khorn

Owner: set to khorn

Changed 13 years ago by khorn

Attachment: lore_lint_fix.patch added

comment:3 Changed 13 years ago by khorn

attached a simple patch which seems to resolve the issue

comment:4 Changed 13 years ago by Jean-Paul Calderone

Type: enhancementdefect

comment:5 Changed 13 years ago by Thijs Triemstra

Cc: Thijs Triemstra added
Keywords: review added
Owner: khorn deleted

comment:6 Changed 13 years ago by khorn

Cc: khorn added

comment:7 Changed 13 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: set to khorn

It'd be awesome if you could also add a unit test for this problem.

Thanks!

Changed 13 years ago by khorn

Attachment: lore_lint_fix.2.patch added

patch with test added

comment:8 Changed 13 years ago by khorn

Keywords: review added
Owner: khorn deleted

New version of patch with unit test added.

test length: 21 lines. patch length: -4 characters.

:)

anyhoo, back to review

comment:9 Changed 13 years ago by therve

Owner: set to therve

comment:10 Changed 13 years ago by therve

Author: therve
Branch: branches/lore-lint-4051

(In [27480]) Branching to 'lore-lint-4051'

comment:11 Changed 13 years ago by therve

Resolution: fixed
Status: newclosed

(In [27482]) Merge lore-lint-4051

Author: khorn Reviewer: therve Fixes: #4051

Fix lint option of lore to not break on link checks.

comment:12 Changed 13 years ago by therve

Keywords: review removed

Thanks a lot for the patch!

comment:13 Changed 11 years ago by <automation>

Owner: therve deleted
Note: See TracTickets for help on using tickets.