Skip to content

Instantly share code, notes, and snippets.

@artragis
artragis / detector.py
Last active January 8, 2019 12:46
Détecteur de mauvaix titre pour big tuto
from argparse import ArgumentParser
def warn_title(title, parents):
nb_of_sharp = title.count('#')
bias = min(len(parents), 3)
final_number = max(nb_of_sharp - len(parents) - bias, 1)
print('AVERTISSEMENT', title[min(len(parents) - 1, 3):], 'devrait être', '#' * (final_number), title.replace('#', ''))
def error_title(title, parents):
nb_of_sharp = title.count('#')
bias = min(len(parents), 3)