-
Notifications
You must be signed in to change notification settings - Fork 7.1k
add ufmt
as code formatter
#4384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ce040e7
a2ea263
a1649e8
713377d
837b07b
333fb87
10652cc
6dcfd59
d91665c
705008c
f2e224c
c0624f7
3e140d6
7ed911a
cfc9b0a
0fc0cf2
9cf0cec
8477cb8
c27c869
6811faf
60fdfda
bd91974
841d5c9
0dc71f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[tool.usort] | ||
|
||
[tool.usort.known] | ||
|
||
first_party = ["torch", "torchvision"] | ||
pmeier marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[tool.black] | ||
|
||
line-length = 120 | ||
target-version = ["py36"] | ||
|
||
[tool.ufmt] | ||
|
||
excludes = [ | ||
"gallery", | ||
] | ||
pmeier marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,14 @@ max-line-length = 120 | |
|
||
[flake8] | ||
max-line-length = 120 | ||
ignore = F401,E402,F403,W503,W504,F821 | ||
ignore = E203, E402, W503, W504, F821 | ||
per-file-ignores = | ||
__init__.py: F401, F403, F405 | ||
./hubconf.py: F401 | ||
torchvision/models/mobilenet.py: F401, F403 | ||
torchvision/models/quantization/mobilenet.py: F401, F403 | ||
test/smoke_test.py: F401 | ||
Comment on lines
+12
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #4178 (comment) for details on this change. |
||
exclude = venv | ||
|
||
[pydocstyle] | ||
select = D417 # Missing argument descriptions in the docstring | ||
select = D417 # Missing argument descriptions in the docstring |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
from torch import nn, Tensor | ||
|
||
import torchvision | ||
from torchvision.ops import roi_align | ||
from .roi_align import roi_align | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just curious, was this flagged somehow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #4178 (comment). In short: we relied on a specific order of the imports due to a naming conflict. Without this fix we need to exclude these imports from being sorted. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There might have been a reason for that initially, but I'm wondering why we even use absolute imports within the (anyway, this is for another PR, let's leave it as is :) ) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps because absolute import is recommended by PEP8? |
||
from torchvision.ops.boxes import box_area | ||
|
||
from typing import Optional, List, Dict, Tuple, Union | ||
|
Uh oh!
There was an error while loading. Please reload this page.