mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-14 17:13:25 -05:00
flake8-print is a flake8 plugin that checks for `print()` statements in Python files. This should save us having to manually spot these when reviewing pull requests. The `--enable=T` flag needs to be set until this bug is fixed: https://github.com/JBKahn/flake8-print/issues/27
12 lines
373 B
Python
12 lines
373 B
Python
from flask import current_app
|
|
|
|
|
|
def list_routes():
|
|
"""List URLs of all application routes."""
|
|
for rule in sorted(current_app.url_map.iter_rules(), key=lambda r: r.rule):
|
|
print("{:10} {}".format(", ".join(rule.methods - set(['OPTIONS', 'HEAD'])), rule.rule)) # noqa
|
|
|
|
|
|
def setup_commands(application):
|
|
application.cli.command('list-routes')(list_routes)
|