Skip to content
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

Constants in ALL_CAPS shouldn't be reported as errors. #52

Merged
merged 1 commit into from
Mar 24, 2015

Conversation

adiroiban
Copy link
Member

For example MAX_LENGTH.


Imported from Launchpad using lp2gh.

@adiroiban
Copy link
Member

I have converted this issue into a pull request... let me know if you prefer to have separate pull requests for an issue.


Now the initial issue report is brief.

twistedchecker does not report ALL_CAPS constants as error... it only does so when the constants are not used in a constant like context, ie instance attribute context.

For example in twisted/protocols/amp.py I see

    def proto_value(self, string):
        """
        String received in the 'value' state.
        """
        self._currentBox[self._currentKey] = string
        self._currentKey = None
        self.MAX_LENGTH = self._MAX_KEY_LENGTH
        return 'key'

I have extended the attribute regex to allow for all caps names.

To check how pylint works I have also tried to replace "self" with "me" and it looks like in this case instance member are no longer detected as being attributes.

Please take a looks and see if this make sense.

Thanks!

@glyph
Copy link
Member

glyph commented Mar 24, 2015

Once again, looks good.

glyph added a commit that referenced this pull request Mar 24, 2015
Constants in ALL_CAPS shouldn't be reported as errors.
@glyph glyph merged commit 3989f20 into master Mar 24, 2015
@glyph glyph deleted the 52-all-caps-attributes branch March 24, 2015 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants