mirror of https://github.com/zulip/zulip.git
linter: Add lint rule banning 'import os.path'
This commit is contained in:
parent
f965a156a9
commit
928dd06cc8
|
@ -3,7 +3,7 @@ Use libraries from a virtualenv (by modifying sys.path) in production.
|
|||
Also add Zulip's root directory to sys.path
|
||||
"""
|
||||
|
||||
import os.path
|
||||
import os
|
||||
import sys
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
|
|
@ -326,6 +326,9 @@ def build_custom_checkers(by_lang):
|
|||
{'pattern': 'from os.path',
|
||||
'description': "Don't use from when importing from the standard library",
|
||||
},
|
||||
{'pattern': 'import os.path',
|
||||
'description': "Use import os instead of import os.path",
|
||||
},
|
||||
]) + whitespace_rules
|
||||
bash_rules = [
|
||||
{'pattern': '#!.*sh [-xe]',
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os.path
|
||||
import os
|
||||
import optparse
|
||||
import time
|
||||
import json
|
||||
|
|
|
@ -11,7 +11,7 @@ import logging
|
|||
import traceback
|
||||
from six.moves import urllib
|
||||
import re
|
||||
import os.path
|
||||
import os
|
||||
import glob
|
||||
import html
|
||||
import twitter
|
||||
|
|
|
@ -18,7 +18,6 @@ import base64
|
|||
import random
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
import hashlib
|
||||
import six
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from __future__ import absolute_import
|
||||
import os.path
|
||||
import os
|
||||
|
||||
from typing import Dict, List, Optional, TypeVar, Any, Text
|
||||
from django.conf import settings
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
import os.path
|
||||
import os
|
||||
import sourcemap
|
||||
from six.moves import map
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from typing import Dict, Optional, Any, List
|
||||
import os.path
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
from django.template import Library, loader, engines
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from django.conf.urls import url
|
||||
from django.conf import settings
|
||||
from django.views.generic import TemplateView
|
||||
import os.path
|
||||
import os
|
||||
from django.views.static import serve
|
||||
import zerver.views.registration
|
||||
import zerver.views.auth
|
||||
|
|
|
@ -3,7 +3,7 @@ from django.conf.urls import url, include
|
|||
from django.conf.urls.i18n import i18n_patterns
|
||||
from django.views.generic import TemplateView, RedirectView
|
||||
from django.utils.module_loading import import_string
|
||||
import os.path
|
||||
import os
|
||||
import zerver.forms
|
||||
from zproject import dev_urls
|
||||
from zproject.legacy_urls import legacy_urls
|
||||
|
|
Loading…
Reference in New Issue