Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

hash symbols inside strings are regarded as comments #110

Open
glyph opened this issue Feb 18, 2016 · 4 comments
Open

hash symbols inside strings are regarded as comments #110

glyph opened this issue Feb 18, 2016 · 4 comments

Comments

@glyph
Copy link
Member

glyph commented Feb 18, 2016

This module produces an error.

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

"""
OK
"""

test("#Test")
@glyph
Copy link
Member Author

glyph commented Feb 18, 2016

Bisected locally; the offending commit is e4da75a

@adiroiban
Copy link
Member

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
Copy link
Member

There is also this

class SimpleConfFile:
    """
    some docstring
    """

    commentChar = '#'
    defaultFilename = None

maybe we should just disable this check

@ralphm
Copy link
Member

ralphm commented Jun 4, 2016

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

ralphm added a commit to twisted/twisted that referenced this issue Jun 4, 2016
This is a workaround for a bug in twistedchecker that seems to look
inside strings and sees # as comments. The corresponding ticket is:
twisted/twistedchecker#110
rodrigc added a commit to twisted/twisted that referenced this issue Dec 20, 2016
jlitzingerdev added a commit to jlitzingerdev/twisted that referenced this issue Jul 21, 2018
This works around a twistedchecker issue:

twisted/twistedchecker#110

Recommended during review.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants