twisted / twistedchecker

twistedchecker is a tool to automatically verify code against the Twisted coding standard.
MIT License
9 stars 13 forks source link

hash symbols inside strings are regarded as comments #110

Open glyph opened 8 years ago

glyph commented 8 years ago

This module produces an error.

# -*- test-case-name: nothing -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
OK
"""

test("#Test")
glyph commented 8 years ago

Bisected locally; the offending commit is e4da75a227565da05befbe1c3951fac7357e0f33

adiroiban commented 8 years ago

Thanks for the report.

I don't know how to fix this in a quick and clean way.

I have updated the examples from the test input in https://github.com/twisted/twistedchecker/compare/110-hash-in-string

./build/bin/twistedchecker twistedchecker/functionaltests/comments.py
adiroiban commented 8 years ago

There is also this

class SimpleConfFile:
    """
    some docstring
    """

    commentChar = '#'
    defaultFilename = None

maybe we should just disable this check

ralphm commented 8 years ago

I hit this again for twisted.words.xish.xpathparser, which is generated by Yapps, and then wrapped in exec(r''' ''').