Skip to content

Instantly share code, notes, and snippets.

View Finwood's full-sized avatar

Lasse Fröhner Finwood

  • starcopter
  • Braunschweig, Germany
  • 16:17 (UTC +02:00)
View GitHub Profile
@caryan
caryan / pylint_to_gitlab_codeclimate.py
Last active February 23, 2024 07:40
Convert pylint output to simplified CodeClimate JSON suitable for Gitlab Code Quality checks
import hashlib
import html
import json
import sys
from typing import Optional
from pylint.reporters import JSONReporter
from pylint.lint import Run
# map pylint categories to CodeClimate severity
import logging.handlers
import smtplib
class BufferingSMTPHandler(logging.handlers.BufferingHandler):
def __init__(self, mailhost, fromaddr, toaddrs, subject, capacity):
logging.handlers.BufferingHandler.__init__(self, capacity)
self.mailhost = mailhost
self.mailport = None
self.fromaddr = fromaddr
if isinstance(toaddrs, (str, unicode)):