Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_package_version():
packages = ["pycodestyle: {0}".format(pycodestyle.__version__)]
return ", ".join(packages)
def _get_package_version():
packages = ["pycodestyle: {0}".format(pycodestyle.__version__)]
return ", ".join(packages)
def _register_extensions():
"""Register all the extensions."""
extensions = util.OrderedSet()
extensions.add(('pycodestyle', pep8.__version__))
parser_hooks = []
options_hooks = []
ignored_hooks = []
try:
from pkg_resources import iter_entry_points
except ImportError:
pass
else:
for entry in iter_entry_points('flake8.extension'):
# Do not verify that the requirements versions are valid
checker = _load_entry_point(entry, verify_requirements=False)
pep8.register_check(checker, codes=[entry.name])
extensions.add((checker.name, checker.version))
if hasattr(checker, 'add_options'):
parser_hooks.append(checker.add_options)
if hasattr(checker, 'parse_options'):
def _get_package_version():
packages = ["pycodestyle: {0}".format(pycodestyle.__version__)]
return ", ".join(packages)
def _get_package_version():
packages = ["pycodestyle: {0}".format(pycodestyle.__version__)]
return ", ".join(packages)
Parameters
----------
config : dict
The dictionary loaded from ``trapdoor.cfg``.
args : argparse.Namespace
The result of parsing the command line arguments.
Returns
-------
counter : collections.Counter
Counts of the number of messages of a specific type in a certain file.
messages : Set([]) of strings
All errors encountered in the current branch.
"""
# Get version
print 'USING PYCODESTYLE :', pycodestyle.__version__
# Call pycodestyle
styleguide = pycodestyle.StyleGuide(reporter=CompleteReport,
config_file=self.config_file)
styleguide.options.exclude.extend(config['py_exclude'])
print 'EXCLUDED FILES :', styleguide.options.exclude
print 'IGNORED MESSAGES :', styleguide.options.ignore
print 'MAX LINE LENGTH :', styleguide.options.max_line_length
for py_directory in config['py_directories']:
print 'RUNNING : pycodestyle %s (through Python API)' % py_directory
styleguide.input_dir(py_directory)
# Parse the output of PyCodeStyle into standard return values
counters = Counter(styleguide.options.report.counters)
del counters['physical lines']
del counters['logical lines']