Skip to content

Commit 3418e22

Browse files
authored
Do argparse parsing of config file first (#6119)
1 parent f9839a1 commit 3418e22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pylint/config/config_initialization.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ def _config_initialization(
3232
linter.set_current_module(config_file)
3333

3434
# Read the configuration file
35+
config_file_parser = config._ConfigurationFileParser(verbose_mode, linter)
3536
try:
36-
# The parser is stored on linter.cfgfile_parser
37-
linter.read_config_file(config_file=config_file_path, verbose=verbose_mode)
37+
config_data = config_file_parser.parse_config_file(file_path=config_file_path)
3838
except OSError as ex:
3939
print(ex, file=sys.stderr)
4040
sys.exit(32)
41-
config_parser = linter.cfgfile_parser
4241

43-
config_file_parser = config._ConfigurationFileParser(verbose_mode, linter)
4442
try:
45-
config_data = config_file_parser.parse_config_file(file_path=config_file_path)
43+
# The parser is stored on linter.cfgfile_parser
44+
linter.read_config_file(config_file=config_file_path, verbose=verbose_mode)
4645
except OSError as ex:
4746
print(ex, file=sys.stderr)
4847
sys.exit(32)
48+
config_parser = linter.cfgfile_parser
4949

5050
# Run init hook, if present, before loading plugins
5151
if config_parser.has_option("MASTER", "init-hook"):

0 commit comments

Comments
 (0)