Skip to content

Commit

Permalink
add isort config
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Nov 24, 2022
1 parent d2f87d9 commit 264650e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ repos:
hooks:
- id: black
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
Expand Down
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,30 @@
exclude = "build"
line-length = 80
skip-string-normalization = true

[tool.isort]
profile = "black"
line_length = 80
known_first_party = ["paddle"]
skip = ["build", "__init__.py"]
extend_skip_glob = [
# These files do not need to be formatted,
# see .flake8 for more details
"python/paddle/fluid/[!t]**",
"python/paddle/fluid/tra**",
"*_pb2.py",
"python/paddle/utils/gast/**",
"python/paddle/fluid/tests/unittests/npu/**",
"python/paddle/fluid/tests/unittests/mlu/**",

# These files will be fixed in the future
"cmake/**",
"paddle/**",
"r/**",
"tools/**",
"python/paddle/[!f]**",
"python/paddle/fluid/tests/unittests/[t-z]**",
"python/paddle/fluid/tests/unittests/dygraph_to_static/test_error.py",
"python/paddle/fluid/tests/unittests/dygraph_to_static/**",
"python/paddle/fluid/tests/unittests/ipu/test_dy2static_ipu.py",
]

0 comments on commit 264650e

Please sign in to comment.