Skip to content

urlpatterns marked as "Invalid constant name" #90

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

Closed
webmaster128 opened this issue Feb 25, 2017 · 2 comments
Closed

urlpatterns marked as "Invalid constant name" #90

webmaster128 opened this issue Feb 25, 2017 · 2 comments

Comments

@webmaster128
Copy link

I can confirm the issue in the now closed #41: pylint with pylint-django enabled marks the Django constant name urlpatterns as invalid.

My mymodule/urls.py is

from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]

and the error

$ PYTHONPATH=. pylint --load-plugins pylint_django mymodule/urls.py 
************* Module patches.urls
C:  4, 0: Invalid constant name "urlpatterns" (invalid-name)

All other files are linted fine, so I guess my setup is okay.

// Python 3.5.2
Django==1.10.5
...
pylint==1.6.5
pylint-django==0.7.2
pylint-plugin-utils==0.2.4
@ghost
Copy link

ghost commented Nov 6, 2017

I have the same problem (Though with Django 1.11.x and pylint 1.7.2)

@atodorov
Copy link
Contributor

Fixed in #109, #113

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

2 participants