Skip to content
Myr

remove audit command

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parent be42d56 · Browse files · 1 file+1 added−38 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−38 removed

  • other:+1 added−38 removed

1 file+1 added−38 removed

modified:setup.py+1 added-38 removed
44 unmodified lines
45from __future__ import print_function46from setuptools import Command, setup474849class run_audit(Command):50 """Audits source code using PyFlakes for following issues:51 - Names which are used but not defined or used before they are defined.52 - Names which are redefined without having been used.53 """54 description = "Audit source code with PyFlakes"55 user_options = []5657 def initialize_options(self):58 pass5960 def finalize_options(self):61 pass6263 def run(self):64 import os65 import sys66 try:67 import pyflakes.scripts.pyflakes as flakes68 except ImportError:69 print("Audit requires PyFlakes installed in your system.")70 sys.exit(-1)7172 warns = 073 # Define top-level directories74 dirs = ('flask', 'examples', 'scripts')75 for dir in dirs:76 for root, _, files in os.walk(dir):77 for file in files:78 if file != '__init__.py' and file.endswith('.py'):79 warns += flakes.checkPath(os.path.join(root, file))80 if warns > 0:81 print("Audit finished with total %d warnings." % warns)82 else:83 print("No problems found in sourcecode.")8449setup(50 name='Flask',51 version='0.11-dev',52 url='http://github.com/mitsuhiko/flask/',
26 unmodified lines
79 ],80 entry_points='''81 [console_scripts]82 flask=flask.cli:main119 ''',120 cmdclass={'audit': run_audit}83 '''84)