Skip to content

Commit 67d0748

Browse files
authored
Cleanup quality (#21493)
* Remove mentions of flake8/isort * Clean up inits * Deall with all other inits * Last special rule for dummy files
1 parent 571fa58 commit 67d0748

File tree

220 files changed

+26
-832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+26
-832
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,7 @@ tags
163163
*.lock
164164

165165
# DS_Store (MacOS)
166-
.DS_Store
166+
.DS_Store
167+
168+
# ruff
169+
.ruff_cache

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions

docs/source/en/add_new_model.mdx

Lines changed: 1 addition & 1 deletion

docs/source/en/pr_checks.mdx

Lines changed: 2 additions & 2 deletions

docs/source/es/pr_checks.mdx

Lines changed: 2 additions & 2 deletions

docs/source/it/add_new_model.mdx

Lines changed: 1 addition & 1 deletion

examples/research_projects/movement-pruning/emmental/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flake8: noqa
21
from .configuration_bert_masked import MaskedBertConfig
32
from .modeling_bert_masked import (
43
MaskedBertForMultipleChoice,
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# flake8: noqa
21
from .binarizer import MagnitudeBinarizer, ThresholdBinarizer, TopKBinarizer
32
from .masked_nn import MaskedLinear

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ ignore = ["E501", "E741", "W605"]
88
select = ["E", "F", "I", "W"]
99
line-length = 119
1010

11+
# Ignore import violations in all `__init__.py` files.
12+
[tool.ruff.per-file-ignores]
13+
"__init__.py" = ["E402", "F401", "F403", "F811"]
14+
"src/transformers/file_utils.py" = ["F401"]
15+
"src/transformers/utils/dummy_*.py" = ["F401"]
16+
1117
[tool.ruff.isort]
1218
lines-after-imports = 2
1319
known-first-party = ["transformers"]

src/transformers/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# flake8: noqa
2-
# There's no way to ignore "F401 '...' imported but unused" warnings in this
3-
# module, but to preserve other warnings. So, don't check this module at all.
4-
51
# Copyright 2020 The HuggingFace Team. All rights reserved.
62
#
73
# Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)