Skip to content

Commit

Permalink
Update ruff. Fix PLE & LOG lints (#3050)
Browse files Browse the repository at this point in the history
* Update ruff. Fix and enable PLE lints

* Enable LOG checks too
  • Loading branch information
Skylion007 authored Feb 22, 2024
1 parent d3987a0 commit 9ecea4f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_language_version:
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.282
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion composer/cli/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def main():
args = _parse_args()

logging.basicConfig()
log.setLevel(logging.INFO if args.verbose else logging.WARN)
log.setLevel(logging.INFO if args.verbose else logging.WARNING)

processes = {}

Expand Down
2 changes: 1 addition & 1 deletion composer/profiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ def export_memory_timeline_html(prof: TorchProfile,

with open(path, 'w') as f:
f.write(html)
log.debug('Memory timeline exported to', path, '.')
log.debug('Memory timeline exported to %s.', path)
remove(tmpfile.name)
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@ line_length = 120
skip = [ "env", "wandb", "runs", "build", "node_modules" ]
known_third_party = ["wandb"]

[tool.ruff]
[tool.ruff.lint]
select = [
"C4",
# TODO port pydocstyle
# "D", # pydocstyle
"LOG",
"PERF",
"PLE",
]

ignore = [
"C408",
"PERF2",
"PERF4",
]
[tool.ruff]
exclude = [
"build/**",
"docs/**",
Expand Down

0 comments on commit 9ecea4f

Please sign in to comment.