Skip to content

Commit

Permalink
Excluded future functorch path from linters (pytorch#81563)
Browse files Browse the repository at this point in the history
In preparation for the functorch->pytorch move, this PR excludes
functorch paths from lint so we avoid breaking lint when we execute the
move. We will fix and re-enable lint when we're done with the merge.

Why not add all these linters to the pytorch/functorch repo now and fix
all the lints? Because (1) it's easier to not add them, especially if
we're moving out of there soon and (2) it's difficult to reproduce the
linting setup 1:1 (I tried for a bit).

Test Plan:
- cp functorch to functorch, run `lintrunner`, observe all pass
Pull Request resolved: pytorch#81563
Approved by: https://github.com/ezyang
  • Loading branch information
zou3519 authored and pytorchmergebot committed Jul 18, 2022
1 parent 99c464a commit d82d208
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ exclude =
./docs/caffe2,
./docs/cpp/src,
./docs/src,
# See NOTE: [Impending functorch move]
./functorch,
./scripts,
./test/generated_type_hints_smoketest.py,
./third_party,
Expand Down
19 changes: 18 additions & 1 deletion .lintrunner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ exclude_patterns = [
'docs/caffe2/**',
'docs/cpp/src/**',
'docs/src/**',
# NOTE: [Impending functorch move]
# In preparation for the functorch -> pytorch merge,
# we are adding the following excludes so that functorch passes
# lint when it gets merged in. Please don't delete.
'functorch/**',
'scripts/**',
'test/generated_type_hints_smoketest.py',
'third_party/**',
Expand Down Expand Up @@ -220,7 +225,11 @@ command = [
[[linter]]
code = 'TYPEIGNORE'
include_patterns = ['**/*.py', '**/*.pyi']
exclude_patterns = ['test/test_jit.py']
exclude_patterns = [
'test/test_jit.py',
# See NOTE: [Impending functorch move]
'functorch/**',
]
command = [
'python3',
'tools/linter/adapters/grep_linter.py',
Expand Down Expand Up @@ -292,6 +301,8 @@ exclude_patterns=[
'tools/clang_format_hash/**',
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
# See NOTE: [Impending functorch move]
'functorch/**',
]
command = [
'python3',
Expand All @@ -311,6 +322,8 @@ exclude_patterns = [
'aten/src/ATen/native/vulkan/api/vk_mem_alloc.h',
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
# See NOTE: [Impending functorch move]
'functorch/**',
]
command = [
'python3',
Expand Down Expand Up @@ -340,6 +353,8 @@ exclude_patterns = [
'test/cpp/jit/upgrader_models/*.ptl',
'test/cpp/jit/upgrader_models/*.ptl.ff',
'.lintrunner.toml',
# See NOTE: [Impending functorch move]
'functorch/**',
]
command = [
'python3',
Expand Down Expand Up @@ -421,6 +436,8 @@ exclude_patterns = [
'**/git-pre-commit',
'**/git-clang-format',
'**/gradlew',
# See NOTE: [Impending functorch move]
'functorch/**',
]
command = [
'python3',
Expand Down

0 comments on commit d82d208

Please sign in to comment.