move and update flake8 config
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 8bfc058 · Browse files · 6 files·+33 added−35 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+33 added−35 removed
- tests:+7 added−7 removed
- other:+26 added−28 removed
Provenance
- Commit
99b34f7- Tree
254a47f- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
8bfc058
6 files changed+33 added−35 removed
modified:examples/javascript/js_example/__init__.py+1 added-1 removed
1 from flask import Flask2 3 app = Flask(__name__)4 5-from js_example import views # noqa: F4015+from js_example import views # noqa: E402, F401modified:tests/test_apps/blueprintapp/__init__.py+2 added-2 removed
1 from flask import Flask2 3 app = Flask(__name__)4 app.config["DEBUG"] = True5-from blueprintapp.apps.admin import admin6-from blueprintapp.apps.frontend import frontend5+from blueprintapp.apps.admin import admin # noqa: E4026+from blueprintapp.apps.frontend import frontend # noqa: E4027 8 app.register_blueprint(admin)9 app.register_blueprint(frontend)modified:tests/test_appctx.py+3 added-3 removed
118 unmodified lines119 cleanup_stuff.append(exception)120 121 @app.route("/")122 def index():123- raise Exception("dummy")123+ raise ValueError("dummy")124 125- with pytest.raises(Exception, match="dummy"):125+ with pytest.raises(ValueError, match="dummy"):126 with app.app_context():127 client.get("/")128 129 assert len(cleanup_stuff) == 1130- assert isinstance(cleanup_stuff[0], Exception)130+ assert isinstance(cleanup_stuff[0], ValueError)131 assert str(cleanup_stuff[0]) == "dummy"132 133 134 def test_app_ctx_globals_methods(app, app_ctx):78 unmodified linesmodified:tests/test_basic.py+2 added-2 removed
1470 unmodified lines1471 with app.test_request_context():1472 rv = flask.url_for("static", filename="index.html", _external=True)1473 assert rv == "http://example.com/static/index.html"1474 # Providing static_host without host_matching=True should error.1475- with pytest.raises(Exception):1475+ with pytest.raises(AssertionError):1476 flask.Flask(__name__, static_host="example.com")1477 # Providing host_matching=True with static_folder1478 # but without static_host should error.1479- with pytest.raises(Exception):1479+ with pytest.raises(AssertionError):1480 flask.Flask(__name__, host_matching=True)1481 # Providing host_matching=True without static_host1482 # but with static_folder=None should not error.1483 flask.Flask(__name__, host_matching=True, static_folder=None)475 unmodified linesadded:.flake8+25 added
1+[flake8]2+extend-select =3+ # bugbear4+ B5+ # bugbear opinions6+ B97+ # implicit str concat8+ ISC9+extend-ignore =10+ # slice notation whitespace, invalid11+ E20312+ # line length, handled by bugbear B95013+ E50114+ # bare except, handled by bugbear B00115+ E72216+ # zip with strict=, requires python >= 3.1017+ B90518+ # string formatting opinion, B028 renamed to B90719+ B02820+ B90721+# up to 88 allowed by bugbear B95022+max-line-length = 8023+per-file-ignores =24+ # __init__ exports names25+ src/flask/__init__.py: F401modified:setup.cfg-27 removed
59 unmodified lines60 source =61 src62 */site-packages63 64-[flake8]65-# B = bugbear66-# E = pycodestyle errors67-# F = flake8 pyflakes68-# W = pycodestyle warnings69-# B9 = bugbear opinions70-# ISC = implicit str concat71-select = B, E, F, W, B9, ISC72-ignore =73- # slice notation whitespace, invalid74- E20375- # import at top, too many circular import fixes76- E40277- # line length, handled by bugbear B95078- E50179- # bare except, handled by bugbear B00180- E72281- # bin op line break, invalid82- W50383- # requires Python 3.1084- B90585-# up to 88 allowed by bugbear B95086-max-line-length = 8087-per-file-ignores =88- # __init__ exports names89- src/flask/__init__.py: F40190-64 [mypy]65 files = src/flask, tests/typing66 python_version = 3.767 show_error_codes = True29 unmodified lines