Skip to content

Commit

Permalink
[Dev]: Upgrade pre commit hooks (open-mmlab#576)
Browse files Browse the repository at this point in the history
* Upgrade the versions of pre-commit-hooks

* update zh-cn.yaml
  • Loading branch information
zhouzaida authored and austinmw committed Oct 8, 2022
1 parent e7ba579 commit 7700507
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config-zh-cn.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
exclude: ^tests/data/
repos:
- repo: https://gitee.com/openmmlab/mirrors-flake8
rev: 3.8.3
rev: 5.0.4
hooks:
- id: flake8
- repo: https://gitee.com/openmmlab/mirrors-isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://gitee.com/openmmlab/mirrors-yapf
rev: v0.30.0
rev: v0.32.0
hooks:
- id: yapf
- repo: https://gitee.com/openmmlab/mirrors-pre-commit-hooks
rev: v3.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -35,7 +35,7 @@ repos:
- mdformat_frontmatter
- linkify-it-py
- repo: https://gitee.com/openmmlab/mirrors-codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
- repo: https://gitee.com/openmmlab/mirrors-docformatter
Expand All @@ -44,7 +44,7 @@ repos:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
exclude: ^tests/data/
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
rev: v0.32.0
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -35,7 +35,7 @@ repos:
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.1
hooks:
- id: codespell
- repo: https://github.com/myint/docformatter
Expand All @@ -44,7 +44,7 @@ repos:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
Expand Down
2 changes: 1 addition & 1 deletion mmengine/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def fromstring(cfg_str: str, file_format: str) -> 'Config':
# `temp_file` is opened first in `tempfile.NamedTemporaryFile` and
# second in `Config.from_file`.
# In addition, a named temporary file will be removed after closed.
# As a workround we set `delete=False` and close the temporary file
# As a workaround we set `delete=False` and close the temporary file
# before opening again.

with tempfile.NamedTemporaryFile(
Expand Down
2 changes: 1 addition & 1 deletion mmengine/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class MMLogger(Logger, ManagerMixin):
``MMLogger.get_instance`` but not ``logging.getLogger``. This feature
ensures ``MMLogger`` will not be incluenced by third-party logging
config.
- Different from ``logging.Logger``, ``MMLogger`` will not log warrning
- Different from ``logging.Logger``, ``MMLogger`` will not log warning
or error message without ``Handler``.
Examples:
Expand Down
6 changes: 3 additions & 3 deletions mmengine/optim/scheduler/param_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ def _get_value(self):

@PARAM_SCHEDULERS.register_module()
class CosineAnnealingParamScheduler(_ParamScheduler):
r"""Set the parameter value of each parameter group using a cosine annealing
schedule, where :math:`\eta_{max}` is set to the initial value and
:math:`T_{cur}` is the number of epochs since the last restart in SGDR:
r"""Set the parameter value of each parameter group using a cosine
annealing schedule, where :math:`\eta_{max}` is set to the initial value
and :math:`T_{cur}` is the number of epochs since the last restart in SGDR:
.. math::
\begin{aligned}
Expand Down
3 changes: 2 additions & 1 deletion mmengine/runner/log_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def get_log_after_iter(self, runner, batch_idx: int,
for key, value in tag.items():
if key.endswith('lr'):
log_tag.pop(key)
lr_str_list.append(f'{key}: ' f'{value:.{self.num_digits}e}')
lr_str_list.append(f'{key}: '
f'{value:.{self.num_digits}e}')
lr_str = ' '.join(lr_str_list)
# Format log header.
# by_epoch == True
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF = true
SPLIT_BEFORE_EXPRESSION_AFTER_OPENING_PAREN = true

[codespell]
ignore-words-list = nd, ba
ignore-words-list = nd, ba, warmup

0 comments on commit 7700507

Please sign in to comment.