Clean up sub-module import and unneeded +
This commit is contained in:
parent
95761c5023
commit
62b6d62cd7
@ -20,14 +20,11 @@
|
|||||||
"""Custom astroid checker for config calls."""
|
"""Custom astroid checker for config calls."""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import pathlib
|
||||||
import os.path
|
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
import astroid
|
import astroid
|
||||||
from pylint import interfaces, checkers
|
from pylint import interfaces, checkers
|
||||||
from pylint.checkers import utils
|
from pylint.checkers import utils
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS = None
|
OPTIONS = None
|
||||||
@ -63,7 +60,7 @@ class ConfigChecker(checkers.BaseChecker):
|
|||||||
"""Check that we're accessing proper config options."""
|
"""Check that we're accessing proper config options."""
|
||||||
if FAILED_LOAD:
|
if FAILED_LOAD:
|
||||||
if not ConfigChecker.printed_warning:
|
if not ConfigChecker.printed_warning:
|
||||||
print("[WARN] Could not find configdata.yml. Please run " +
|
print("[WARN] Could not find configdata.yml. Please run "
|
||||||
"pylint from qutebrowser root.", file=sys.stderr)
|
"pylint from qutebrowser root.", file=sys.stderr)
|
||||||
print("Skipping some checks...", file=sys.stderr)
|
print("Skipping some checks...", file=sys.stderr)
|
||||||
ConfigChecker.printed_warning = True
|
ConfigChecker.printed_warning = True
|
||||||
@ -77,7 +74,7 @@ def register(linter):
|
|||||||
linter.register_checker(ConfigChecker(linter))
|
linter.register_checker(ConfigChecker(linter))
|
||||||
global OPTIONS
|
global OPTIONS
|
||||||
global FAILED_LOAD
|
global FAILED_LOAD
|
||||||
yaml_file = Path('qutebrowser') / 'config' / 'configdata.yml'
|
yaml_file = pathlib.Path('qutebrowser') / 'config' / 'configdata.yml'
|
||||||
if not yaml_file.exists():
|
if not yaml_file.exists():
|
||||||
OPTIONS = None
|
OPTIONS = None
|
||||||
FAILED_LOAD = True
|
FAILED_LOAD = True
|
||||||
|
Loading…
Reference in New Issue
Block a user