Skip to content

Commit b0e5cd7

Browse files
committed
add tabs
1 parent 9895b96 commit b0e5cd7

File tree

2 files changed

+32
-22
lines changed

2 files changed

+32
-22
lines changed

.pre-commit-config.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@ repos:
1515
rev: v1.39.2
1616
hooks:
1717
- id: typos
18-
args: [--force-exclude]
18+
args: [--force-exclude]
19+
20+
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
21+
rev: v1.5.1
22+
hooks:
23+
- id: remove-crlf
24+
- id: remove-tabs
25+
name: Tabs remver (Python)
26+
files: (.*\.(py|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
27+
args: [--whitespaces-count, '4']
28+
exclude: test/dygraph_to_static/test_error.py

graph_net/__init__.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
__all__ = ["torch", "paddle"]
2-
3-
from importlib import import_module
4-
from typing import TYPE_CHECKING, Any, List
5-
6-
7-
def __getattr__(name: str) -> Any:
8-
if name in __all__:
9-
module = import_module(f"{__name__}.{name}")
10-
globals()[name] = module
11-
return module
12-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
13-
14-
15-
def __dir__() -> List[str]:
16-
return sorted(list(globals().keys()) + __all__)
17-
18-
19-
if TYPE_CHECKING:
20-
from . import torch as torch # type: ignore
21-
from . import paddle as paddle # type: ignore
1+
__all__ = ["torch", "paddle"]
2+
3+
from importlib import import_module
4+
from typing import TYPE_CHECKING, Any, List
5+
6+
7+
def __getattr__(name: str) -> Any:
8+
if name in __all__:
9+
module = import_module(f"{__name__}.{name}")
10+
globals()[name] = module
11+
return module
12+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
13+
14+
15+
def __dir__() -> List[str]:
16+
return sorted(list(globals().keys()) + __all__)
17+
18+
19+
if TYPE_CHECKING:
20+
from . import torch as torch # type: ignore
21+
from . import paddle as paddle # type: ignore

0 commit comments

Comments
 (0)