Skip to content

Commit 86c1032

Browse files
authored
Merge pull request #759 from ipython/pre-commit-ci-update-config
2 parents 3ab6ae7 + a2041f7 commit 86c1032

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,32 +52,28 @@ repos:
5252
- id: prettier
5353

5454
- repo: https://github.com/asottile/pyupgrade
55-
rev: v2.37.2
55+
rev: v2.37.3
5656
hooks:
5757
- id: pyupgrade
5858
args: [--py37-plus]
5959

6060
- repo: https://github.com/PyCQA/doc8
61-
rev: 0.11.2
61+
rev: v1.0.0
6262
hooks:
6363
- id: doc8
6464
args: [--max-line-length=200]
6565
stages: [manual]
6666

6767
- repo: https://github.com/pycqa/flake8
68-
rev: 4.0.1
68+
rev: 5.0.2
6969
hooks:
7070
- id: flake8
7171
additional_dependencies:
72-
[
73-
"flake8-bugbear==20.1.4",
74-
"flake8-logging-format==0.6.0",
75-
"flake8-implicit-str-concat==0.2.0",
76-
]
72+
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
7773
stages: [manual]
7874

7975
- repo: https://github.com/pre-commit/mirrors-eslint
80-
rev: v8.20.0
76+
rev: v8.21.0
8177
hooks:
8278
- id: eslint
8379
stages: [manual]

traitlets/config/application.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -830,12 +830,12 @@ def _load_config_files(cls, basefilename, path=None, log=None, raise_config_file
830830

831831
if not isinstance(path, list):
832832
path = [path]
833-
for path in path[::-1]:
833+
for current in reversed(path):
834834
# path list is in descending priority order, so load files backwards:
835-
pyloader = cls.python_config_loader_class(basefilename + ".py", path=path, log=log)
835+
pyloader = cls.python_config_loader_class(basefilename + ".py", path=current, log=log)
836836
if log:
837-
log.debug("Looking for %s in %s", basefilename, path or os.getcwd())
838-
jsonloader = cls.json_config_loader_class(basefilename + ".json", path=path, log=log)
837+
log.debug("Looking for %s in %s", basefilename, current or os.getcwd())
838+
jsonloader = cls.json_config_loader_class(basefilename + ".json", path=current, log=log)
839839
loaded: t.List[t.Any] = []
840840
filenames: t.List[str] = []
841841
for loader in [pyloader, jsonloader]:
@@ -882,17 +882,17 @@ def load_config_file(self, filename, path=None):
882882
"""Load config files by filename and path."""
883883
filename, ext = os.path.splitext(filename)
884884
new_config = Config()
885-
for (config, filename) in self._load_config_files(
885+
for (config, fname) in self._load_config_files(
886886
filename,
887887
path=path,
888888
log=self.log,
889889
raise_config_file_errors=self.raise_config_file_errors,
890890
):
891891
new_config.merge(config)
892892
if (
893-
filename not in self._loaded_config_files
893+
fname not in self._loaded_config_files
894894
): # only add to list of loaded files if not previously loaded
895-
self._loaded_config_files.append(filename)
895+
self._loaded_config_files.append(fname)
896896
# add self.cli_config to preserve CLI config priority
897897
new_config.merge(self.cli_config)
898898
self.update_config(new_config)

0 commit comments

Comments
 (0)