Skip to content

Commit 9accded

Browse files
authored
ruff setup and pre-commit (pytorch#57)
1 parent 3ee42b6 commit 9accded

File tree

4 files changed

+8
-35
lines changed

4 files changed

+8
-35
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,9 @@ repos:
88
- id: debug-statements
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
11-
# - repo: https://github.com/PyCQA/isort
12-
# rev: 5.13.2
13-
# hooks:
14-
# - id: isort
15-
# args: [--profile, black]
16-
- repo: https://github.com/PyCQA/flake8
17-
rev: 7.1.1
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.7.4
1813
hooks:
19-
- id: flake8
20-
args: ['--ignore=E501,E203,E731,W503']
21-
- repo: https://github.com/psf/black
22-
rev: 24.10.0
23-
hooks:
24-
- id: black
25-
# - repo: https://github.com/pre-commit/mirrors-mypy
26-
# rev: v1.10.0
27-
# hooks:
28-
# - id: mypy
29-
# additional_dependencies: [types-dataclasses, numpy]
14+
- id: ruff
15+
args: [ --fix ]
16+
- id: ruff-format

pyproject.toml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,6 @@ dev-dependencies = [
3232
[tool.setuptools]
3333
packages = ["low_bits_training", "low_bits_training.datasets", "low_bits_training.models"]
3434

35-
[tool.black]
35+
[tool.ruff]
3636
line-length = 90
37-
target-version = ['py310']
38-
39-
[tool.isort]
40-
line_length = 90
41-
py_version = 310
42-
43-
[tool.mypy]
44-
python_version = "3.10"
45-
show_error_codes = true
46-
warn_redundant_casts = true
47-
warn_unused_ignores = true
48-
warn_unused_configs = true
49-
check_untyped_defs = true
50-
disallow_any_generics = true
51-
no_implicit_optional = false
37+
target-version = 'py310'

scripts/download_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def sync_between_nodes(source_path, source_host, dest_path, dest_host):
4747

4848

4949
def main(args):
50-
5150
run = wandb.init(
5251
entity=args.entity,
5352
project=args.project,

scripts/titan_sweep.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
python sweep.py --config '{"command":"./train.sh", ...}' # JSON string
1818
1919
"""
20+
2021
import json
2122
import argparse
2223
from itertools import product

0 commit comments

Comments
 (0)