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

Invalid constant name "application" (invalid-name) #77

Closed
craiga opened this issue Jun 22, 2016 · 9 comments
Closed

Invalid constant name "application" (invalid-name) #77

craiga opened this issue Jun 22, 2016 · 9 comments
Assignees

Comments

@craiga
Copy link

craiga commented Jun 22, 2016

pylint_django complains about Django-generated code:

$ django-admin startproject testproj
$ cd testproj
$ pylint --load-plugins pylint_django testproj
No config file found, using default configuration
************* Module testproj.wsgi
C: 16, 0: Invalid constant name "application" (invalid-name)
…

Using: pylint==1.5.6 and pylint-django==0.7.2.

@jasjuang
Copy link

Ran into the same problem. Would be great to see this fixed.

@sieira
Copy link

sieira commented Jul 3, 2017

+1

@cactail
Copy link

cactail commented Jul 8, 2017

Same problem here. Should I ignore the wsgi.py module?

@bittner
Copy link
Contributor

bittner commented Oct 7, 2017

@cactail

As an alternative to disabling the message or ignoring the whole module, using PyLint's --good-names may be a soft enough option:

$ pylint testproj --load-plugins=pylint_django --good-names=application

As usual, those options can also go into a PyLint configuration file to save typing on the command line:

# FILE: pylintrc  or .pylintrc
load-plugins = pylint_django
good-names = application

@carlio

Where would code to ignore "application" (invalid-name) have to go? augmentations looks like the right place, but it's really not all that obvious what to do. Can you give a hint?

As invalid-name corresponds to C0103, the code would probably have to look similar to the media attributes suppression. Does checking whether application then is an attribute of a module named wsgi make sense?

@bittner
Copy link
Contributor

bittner commented Jan 23, 2018

Any hint to start tackling this issue would be greatly appreciated, @carlio!

Who will take care of maintenance and PRs in future, now that this repo is under the PyCQA umbrella?

@atodorov
Copy link
Contributor

@bittner @colinhowe and myself joined this project as new maintainers just before it moved under PyCQA. I have closed a few issues yesterday and will continue to work on the rest during the next few weeks.

Not sure what my permissions on the repo are after the move but I will gladly continue maintaining this package.

@carlio
Copy link
Collaborator

carlio commented Jan 23, 2018

@bittner @atodorov @colinhowe I'll will certainly be helping and now others are too and hopefully with the new moves it will help keep things going :-) It was a bit staid when I was on it alone so I think this is a good move for users and the lib itself.

@bittner
Copy link
Contributor

bittner commented Jan 23, 2018

Okay, thanks!

Remains the first part of the question to be answered: 😏

Any hint to start tackling this issue would be greatly appreciated, @carlio!

@atodorov
Copy link
Contributor

@bittner the easiest way will be to append 'application' to good_names in pylint_django/plugin.py.

The other will be to add an augmentation which silences the invalid-name message from pylint when visiting a AssignName node, which is named "application" and lives inside the "wsgi" module. ATM I don't know if astroid nodes carry module information with them but quick look tells me no.

@atodorov atodorov self-assigned this Apr 5, 2018
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

No branches or pull requests

7 participants