From 1af660a5c90f91bccbe9198414ffddac3843114a Mon Sep 17 00:00:00 2001 From: Mergen Nachin Date: Tue, 16 Apr 2024 16:14:21 -0400 Subject: [PATCH] Make flake8 to be more opinionated (#217) Currently it is spitting out too many failures. It is consistent with ExecuTorch linter --- .flake8 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..38ca46745 --- /dev/null +++ b/.flake8 @@ -0,0 +1,76 @@ +[flake8] +select = B,C,E,F,P,W,B9,TOR0,TOR1,TOR2 +max-line-length = 120 +ignore = + # Black conflicts and overlaps. + B950, + E111, + E115, + E117, + E121, + E122, + E123, + E124, + E125, + E126, + E127, + E128, + E129, + E131, + E201, + E202, + E203, + E221, + E222, + E225, + E226, + E227, + E231, + E241, + E251, + E252, + E261, + E262, + E265, + E271, + E272, + E301, + E302, + E303, + E305, + E306, + E501, + E502, + E701, + E702, + E703, + E704, + W291, + W292, + W293, + W391, + W504, + + # Too opinionated. + E265, + E266, + E402, + E722, + B001, + P207, + B003, + P208, + C403, + W503, + + # Bugbear has opinions: https://github.com/PyCQA/flake8-bugbear#opinionated-warnings + B904, + B905, + B906, + B907, +exclude = + ./.git, + *.pyi + +max-complexity = 12 +