Skip to content

Instantly share code, notes, and snippets.

@notpushkin
Created October 1, 2022 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notpushkin/f04466c3010973d8b99f2ce8d148dbaa to your computer and use it in GitHub Desktop.
Save notpushkin/f04466c3010973d8b99f2ce8d148dbaa to your computer and use it in GitHub Desktop.
from wemake_python_styleguide.violations import system, naming, complexity, consistency, best_practices, refactoring, oop
REDIR_TEMPLATE = "/{full_code} https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/violations/{group_name}.html#{full_group_name}.{name}"
violation_groups = {
"system": system,
"naming": naming,
"complexity": complexity,
"consistency": consistency,
"best_practices": best_practices,
"refactoring": refactoring,
"oop": oop,
}
for group_name, group in violation_groups.items():
for name in dir(group):
violation = getattr(group, name)
if hasattr(violation, "full_code"):
print(REDIR_TEMPLATE.format(
full_code=violation.full_code,
group_name=group_name,
full_group_name=group.__name__,
name=violation.__name__,
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment