Преглед на файлове

HUE-9371 [pylint] Move .pylintrc to repo root

Romain преди 6 години
родител
ревизия
e1ef3bd769
променени са 3 файла, в които са добавени 11 реда и са изтрити 11 реда
  1. 4 5
      .pylintrc
  2. 5 4
      desktop/core/src/desktop/settings.py
  3. 2 2
      docs/docs-site/content/developer/development/_index.md

+ 4 - 5
desktop/.pylintrc → .pylintrc

@@ -48,6 +48,7 @@ confidence=
   # W0311(bad-indentation)
   # C0301(line-too-long
 
+
 # Disable the message, report, category or checker with the given id(s). You
 # can either give multiple identifiers separated by comma (,) or put this
 # option multiple times (only on the command line, not in the configuration
@@ -57,7 +58,6 @@ confidence=
 # --enable=similarities". If you want to run only the classes checker, but have
 # no Warning level messages displayed, use"--disable=all --enable=classes
 # --disable=W"
-
 disable=all
 
   #attribute-defined-outside-init,
@@ -128,7 +128,7 @@ ignore-imports=no
 [VARIABLES]
 
 # Tells whether we should check for unused import in __init__ files.
-init-import=no
+init-import=yes
 
 # A regular expression matching the name of dummy variables (i.e. expectedly
 # not used).
@@ -146,7 +146,7 @@ callbacks=cb_,_cb
 [FORMAT]
 
 # Maximum number of characters on a single line.
-max-line-length=150
+max-line-length=140
 
 # Regexp for a line that is allowed to be longer than the limit.
 ignore-long-lines=^\s*(# )?<?https?://\S+>?$
@@ -189,7 +189,7 @@ bad-names=foo,bar,baz,toto,tutu,tata
 name-group=
 
 # Include a hint for the correct naming format with invalid-name
-include-naming-hint=no
+include-naming-hint=yes
 
 # Regular expression matching correct function names
 function-rgx=[a-z_][a-z0-9_]{2,30}$
@@ -378,4 +378,3 @@ int-import-graph=
 # Exceptions that will emit a warning when being caught. Defaults to
 # "Exception"
 overgeneral-exceptions=Exception
-ignored-classes=SQLObject,Config,BoundConfig,ConfigSection

+ 5 - 4
desktop/core/src/desktop/settings.py

@@ -35,17 +35,18 @@ import django_opentracing
 from django.utils.translation import ugettext_lazy as _
 
 import desktop.redaction
-from desktop.lib.paths import get_desktop_root
-from desktop.lib.python_util import force_dict_to_strings
+
 from desktop.conf import has_channels
+from desktop.lib.paths import get_desktop_root, get_run_root
+from desktop.lib.python_util import force_dict_to_strings
 
 from aws.conf import is_enabled as is_s3_enabled
 from azure.conf import is_abfs_enabled
 
+
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
 BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..', '..', '..'))
 
-
 HUE_DESKTOP_VERSION = pkg_resources.get_distribution("desktop").version or "Unknown"
 NICE_NAME = "Hue"
 
@@ -277,7 +278,7 @@ AUTH_PROFILE_MODULE = None
 LOGIN_REDIRECT_URL = "/"
 LOGOUT_REDIRECT_URL = "/" # For djangosaml2 bug.
 
-PYLINTRC = get_desktop_root('.pylintrc')
+PYLINTRC = get_run_root('.pylintrc')
 
 # Custom CSRF Failure View
 CSRF_FAILURE_VIEW = 'desktop.views.csrf_failure'

+ 2 - 2
docs/docs-site/content/developer/development/_index.md

@@ -103,9 +103,9 @@ Restart Hue, open the Editors and start typing your first queries!
 #### Lint configs
 
 * [.eslintrc.js](https://github.com/cloudera/hue/blob/master/.eslintrc.js)
-* [.pylintrc](https://github.com/cloudera/hue/blob/master/desktop/.pylintrc)
+* [.pylintrc](https://github.com/cloudera/hue/blob/master/.pylintrc)
 * [.prettierrc](https://github.com/cloudera/hue/blob/master/.prettierrc)
-* [git hooks](https://github.com/cloudera/hue/blob/master/tools/githooks)
+* [Git hooks](https://github.com/cloudera/hue/blob/master/tools/githooks)
 
     cp tools/githooks/* .git/hooks
     chmod +x .git/hooks/*