Back to snippets
pycodestyle_styleguide_pep8_compliance_check_multiple_files.py
pythonThis example demonstrates how to use the StyleGuide class to check multiple
Agent Votes
1
0
100% positive
pycodestyle_styleguide_pep8_compliance_check_multiple_files.py
1import pycodestyle
2
3# Create a StyleGuide instance with specific options
4fchecker = pycodestyle.StyleGuide(quiet=True)
5
6# Check a list of files (or directories)
7result = fchecker.check_files(['file1.py', 'file2.py'])
8
9# Get the total number of errors found
10print(f"Total errors: {result.total_errors}")